package com.hsc.yalebao.newui;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnDismissListener;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.os.Process;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.text.Editable;
import android.text.Html;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.text.method.LinkMovementMethod;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnFocusChangeListener;
import android.view.View.OnTouchListener;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.PopupWindow.OnDismissListener;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.TextView;
import cn.sharesdk.framework.CustomPlatform;
import cn.sharesdk.framework.Platform;
import cn.sharesdk.framework.ShareSDK;
import cn.sharesdk.tencent.qq.QQ;
import cn.sharesdk.wechat.friends.Wechat;
import com.google.gson.Gson;
import com.hsc.yalebao.base.ActivityStack;
import com.hsc.yalebao.base.BaseActivity;
import com.hsc.yalebao.base.CustomApplication;
import com.hsc.yalebao.base.MainWebActivity;
import com.hsc.yalebao.db.DatabaseHelper;
import com.hsc.yalebao.http.AppConstants;
import com.hsc.yalebao.http.RequestNet;
import com.hsc.yalebao.model.BaseDataObject;
import com.hsc.yalebao.model.GetTopMessageBean;
import com.hsc.yalebao.model.IsBoundPhoneBean;
import com.hsc.yalebao.model.IsSetBankCardBean;
import com.hsc.yalebao.model.IsSetBankCardModel;
import com.hsc.yalebao.model.IsSetPayPasswordBean;
import com.hsc.yalebao.model.MessageTitleBean;
import com.hsc.yalebao.model.TokenModel;
import com.hsc.yalebao.model.UpdateBean;
import com.hsc.yalebao.model.UserBaseBean;
import com.hsc.yalebao.model.UserBean;
import com.hsc.yalebao.otherlogin.LoginApi;
import com.hsc.yalebao.otherlogin.OnLoginListener;
import com.hsc.yalebao.otherlogin.Tool;
import com.hsc.yalebao.otherlogin.UserInfo;
import com.hsc.yalebao.tabChongZhi.ChongzhiActivity;
import com.hsc.yalebao.tabIndex.CustomServiceActivity;
import com.hsc.yalebao.tabMine.BoundBankCardActivity;
import com.hsc.yalebao.tabMine.BoundPhoneActivity;
import com.hsc.yalebao.tabMine.ForgetLoginPwdActivity;
import com.hsc.yalebao.tabMine.JiLuActivity;
import com.hsc.yalebao.tabMine.MineFragment;
import com.hsc.yalebao.tabMine.MyMessageActivity;
import com.hsc.yalebao.tabMine.QianBaoActivity;
import com.hsc.yalebao.tabMine.SafeCodeActivity;
import com.hsc.yalebao.tabMine.TiXianActivity;
import com.hsc.yalebao.tools.AppFinal;
import com.hsc.yalebao.tools.FileTools;
import com.hsc.yalebao.tools.NoDoubleClickUtils;
import com.hsc.yalebao.tools.SharedPreferencesUtil;
import com.hsc.yalebao.tools.SystemHelper;
import com.hsc.yalebao.tools.UiUtil;
import com.hsc.yalebao.tools.Utility;
import com.hsc.yalebao.weight.CustomDialog;
import com.hsc.yalebao.weight.LogUtils;
import com.hsc.yalebao.weight.MyDialog1;
import com.hsc.yalebao.weight.MyUpdateDialog;
import com.hsc.yalebao.weight.RoundImageView;
import com.hsc.yalebao.weight.SystemnotificationDialog;
import com.zhy.http.okhttp.callback.FileCallBack;
import com.zhy.http.okhttp.callback.StringCallback;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.HashMap;
import java.util.Map;
import okhttp3.Call;

public class NewMainActivity extends BaseActivity
  implements View.OnClickListener
{
  public static int loading_process;
  public static LinearLayout[] mLinList;
  public static NewMainActivity mainActivity;
  public static int selectIndex = -1;
  private String TAG = "==MainActivity==";
  String apk_url;
  private int[] bottomBtnIds;
  private int[] bottomLinIds;
  private int[] bottomTvIds;
  private ImageButton button1;
  private ImageButton button2;
  private String camera_fileName;
  NewZhaopinFragment chongZhiFragment = null;
  private CheckBox ck_xieyi;
  private int[] containerIds;
  private FrameLayout[] containers;
  View contentView;
  public Context context;
  NewDongTaiFragment dongtaiFragment = null;
  private EditText edit_bound_psw;
  private EditText edit_bound_username;
  public EditText edit_login_psw;
  public EditText edit_login_username;
  private EditText edit_register_introduce;
  private EditText edit_register_nickname;
  private EditText edit_register_psw;
  private EditText edit_register_rppsw;
  private EditText edit_register_username;
  int featherIndex = 0;
  String[] featherStr = { "正常模式", "白天模式", "夜晚模式" };
  private String geQian;
  private String guid = "";
  Handler handler = new Handler()
  {
    public void handleMessage(Message paramAnonymousMessage)
    {
      super.handleMessage(paramAnonymousMessage);
      String str = paramAnonymousMessage.getData().getString("value");
      if (NewMainActivity.this.isUse)
        if (NewMainActivity.this.isGo)
        {
          NewMainActivity.this.httpupdate();
          if (NewMainActivity.this.indexFragment != null)
            NewMainActivity.this.indexFragment.getDatasFromServer();
        }
      while (true)
      {
        Log.i("mylog", "请求结果为-->" + str);
        return;
        NewMainActivity.this.myDialog12 = new MyDialog1(NewMainActivity.this);
        NewMainActivity.this.myDialog12.setCancelable(false);
        NewMainActivity.this.myDialog12.setMessage("服务器连接失败，请重新连接");
        NewMainActivity.this.myDialog12.btn_confirm.setOnClickListener(new View.OnClickListener()
        {
          public void onClick(View paramAnonymous2View)
          {
            NewMainActivity.this.isGo = true;
            SystemHelper.getServer(NewMainActivity.this);
            new Thread(NewMainActivity.this.networkTask).start();
            NewMainActivity.this.myDialog12.dismiss();
          }
        });
        NewMainActivity.this.myDialog12.show();
      }
    }
  };
  public Button home_rb_nav02;
  private ImageView img;
  String imgName;
  private String imgPartUrl;
  private ImageView img_bound_close;
  private ImageView img_bound_sure;
  private ImageView img_login;
  private ImageView img_new_user;
  private ImageView img_old_user;
  private ImageView img_register;
  InputMethodManager imm;
  NewIndexFragment indexFragment = null;
  Boolean isBundleSaved = Boolean.valueOf(false);
  private boolean isGo = false;
  private boolean isUse = false;
  private boolean isWxDefaultLogin = false;
  public ImageView iv_msg_number;
  private ImageView iv_title_right;
  private String mActionType = "1";
  private Button[] mBtnList;
  long mExitTime = 0L;
  private AlertDialog mModifyDialog;
  float mPosY = 0.0F;
  private TextView[] mTvList;
  NewuiMineFragment mineFragment = null;
  private MyDialog1 myDialog1;
  private MyDialog1 myDialog12;
  MyUpdateDialog myUpdateDialog;
  Runnable networkTask = new Runnable()
  {
    public void run()
    {
      NewMainActivity.this.isUse = NewMainActivity.this.startPing(AppConstants.IP);
      Message localMessage = new Message();
      Bundle localBundle = new Bundle();
      localBundle.putString("value", "请求结果");
      localMessage.setData(localBundle);
      NewMainActivity.this.handler.sendMessage(localMessage);
    }
  };
  public PopupWindow old_userpop;
  View olduserpop;
  View.OnClickListener onClickListener = new View.OnClickListener()
  {
    public void onClick(View paramAnonymousView)
    {
      switch (paramAnonymousView.getId())
      {
      case 2131099700:
      case 2131099701:
      case 2131099703:
      default:
      case 2131099699:
      case 2131099702:
        do
        {
          return;
          if (!CustomApplication.app.isLogin)
          {
            NewMainActivity.this.showLoginPop();
            return;
          }
          NewMainActivity.this.showPopwindow();
          return;
        }
        while (NoDoubleClickUtils.isDoubleClick());
        NewMainActivity.this.startActivity(new Intent(NewMainActivity.this, CustomServiceActivity.class));
        return;
      case 2131099704:
      }
      switch (NewMainActivity.selectIndex)
      {
      case 1:
      case 2:
      case 3:
      default:
        return;
      case 0:
      }
      if (!CustomApplication.app.isLogin)
      {
        NewMainActivity.this.showLoginPop();
        return;
      }
      NewMainActivity.this.showPopupWindowMenu();
      NewMainActivity.this.iv_title_right.setImageResource(2130837627);
    }
  };
  private String paypass;
  public PopupWindow popWindowLeft;
  public PopupWindow popupWindowRight;
  private ImageView qq_login_view;
  private MyReceiver receiverNet = null;
  private String registerIntroduceId = "";
  private String registerNickName = "";
  private String registerUserName = "";
  private String registerUserPsw = "";
  private String registerUserPswRp = "";
  private int screenWidth;
  private ScrollView scroll_register;
  private ScrollView scroll_register_new;
  private PopupWindow selectPopupWindow;
  private TextWatcher textWatcher = new TextWatcher()
  {
    public void afterTextChanged(Editable paramAnonymousEditable)
    {
    }

    public void beforeTextChanged(CharSequence paramAnonymousCharSequence, int paramAnonymousInt1, int paramAnonymousInt2, int paramAnonymousInt3)
    {
    }

    public void onTextChanged(CharSequence paramAnonymousCharSequence, int paramAnonymousInt1, int paramAnonymousInt2, int paramAnonymousInt3)
    {
      if ("".equals(NewMainActivity.this.edit_login_username.getText().toString()))
        NewMainActivity.this.edit_login_psw.setText("");
    }
  };
  private TextView tv_forget_pwd;
  private TextView tv_go_register;
  private TextView tv_lianxi_kefu;
  private TextView tv_user_amount;
  private TextView tv_user_con_psw_tishi;
  private TextView tv_user_name_tishi;
  private TextView tv_user_nick_name_tishi;
  private TextView tv_user_psw_tishi;
  private TextView tv_xieyi;
  Uri uritempFile;
  private String userName = "";
  private String userNickName;
  private String userPsw = "";
  private View viewLeft;
  View viewLogin;
  View viewRegister;
  View viewRight;
  private Map<String, Object> weixinMap = new HashMap();
  private WindowManager windowManager;
  public PopupWindow window_login;
  public PopupWindow window_register;
  public PopupWindow window_register_new;
  private ImageView wx_login_view;

  private void Uninstall(final String paramString)
  {
    if (checkApplication(paramString))
    {
      this.myDialog1.setMessage("系统将为您卸载老版本");
      this.myDialog1.show();
      this.myDialog1.btn_confirm.setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          if ((NewMainActivity.this.myDialog1 != null) && (NewMainActivity.this.myDialog1.isShowing()))
          {
            NewMainActivity.this.myDialog1.dismiss();
            Uri localUri = Uri.parse("package:" + paramString);
            Intent localIntent = new Intent("android.intent.action.DELETE");
            localIntent.setData(localUri);
            NewMainActivity.this.startActivity(localIntent);
          }
        }
      });
    }
  }

  private void bindUserAction(final Map<String, Object> paramMap)
  {
    String str1 = this.edit_bound_username.getText().toString();
    String str2 = this.edit_bound_psw.getText().toString();
    if ("".equals(str1))
    {
      UiUtil.showToast(this.context, "请输入您的账号");
      this.edit_bound_username.requestFocus();
      this.img_bound_sure.setEnabled(true);
      return;
    }
    if ("".equals(str2))
    {
      UiUtil.showToast(this.context, "请输入您的密码");
      this.edit_bound_psw.requestFocus();
      this.img_bound_sure.setEnabled(true);
      return;
    }
    HashMap localHashMap = new HashMap();
    localHashMap.put("nickname", paramMap.get("nickname"));
    localHashMap.put("open_id", paramMap.get("openid"));
    localHashMap.put("headimgurl", paramMap.get("headimgurl"));
    localHashMap.put("client_type", "1");
    localHashMap.put("user_name", str1);
    localHashMap.put("password", str2);
    localHashMap.put("login_type", "2");
    localHashMap.put("client_Id", CustomApplication.app.IMEI);
    LogUtils.d(this.TAG, "userName:" + str1);
    LogUtils.d(this.TAG, "userPsw:" + str2);
    showLoadingDialog();
    RequestNet.get(this.context, AppConstants.URL_GET_OLDUSERLOGIN, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        Log.e(NewMainActivity.this.TAG, "登陆失败,login-result:" + paramAnonymousException);
        NewMainActivity.this.dismissLoadingDialog();
        NewMainActivity.this.img_bound_sure.setEnabled(true);
      }

      public void onResponse(String paramAnonymousString)
      {
        NewMainActivity.this.img_bound_sure.setEnabled(true);
        NewMainActivity.this.dismissLoadingDialog();
        if (paramAnonymousString.isEmpty());
        UserBean localUserBean;
        do
        {
          return;
          Gson localGson = new Gson();
          try
          {
            localUserBean = (UserBean)localGson.fromJson(paramAnonymousString, UserBean.class);
            if (localUserBean == null)
            {
              UiUtil.showToast(NewMainActivity.this.context, "登陆失败");
              return;
            }
          }
          catch (Exception localException)
          {
            while (true)
            {
              localException.printStackTrace();
              localUserBean = null;
            }
            if (localUserBean.getFlag() == -4)
            {
              NewMainActivity.activityStack.backToMain(NewMainActivity.class, NewMainActivity.this);
              return;
            }
            LogUtils.e(NewMainActivity.this.TAG, "s:  " + paramAnonymousString);
            CustomApplication.app.userBaseBean = localUserBean.getResult();
            if (localUserBean.getFlag() != 1)
            {
              NewMainActivity.this.ShowDialog1(localUserBean.getMsg());
              return;
            }
          }
        }
        while (CustomApplication.app.userBaseBean == null);
        LogUtils.i(NewMainActivity.this.TAG, "登陆成功");
        CustomApplication.app.isLogin = true;
        UiUtil.showToast(NewMainActivity.this.context, localUserBean.getMsg());
        NewMainActivity.this.old_userpop.dismiss();
        NewMainActivity.this.selectPopupWindow.dismiss();
        String str1 = CustomApplication.app.userBaseBean.getGuid();
        String str2 = CustomApplication.app.userBaseBean.getAccessToken();
        if ((NewMainActivity.this.dongtaiFragment != null) && (CustomApplication.app.isLogin))
          NewMainActivity.this.dongtaiFragment.getDataFromServer();
        LogUtils.d(NewMainActivity.this.TAG, "guid：" + str1);
        LogUtils.d(NewMainActivity.this.TAG, "accessToken：" + str2);
        LogUtils.d(NewMainActivity.this.TAG, "memberId：" + CustomApplication.app.userBaseBean.getMemberid());
        LogUtils.d(NewMainActivity.this.TAG, "SessionToken：" + CustomApplication.app.userBaseBean.getSessionToken());
        LogUtils.d(NewMainActivity.this.TAG, "IsRoomOwner：" + CustomApplication.app.userBaseBean.IsRoomOwner);
        LogUtils.d(NewMainActivity.this.TAG, "nick_name：" + CustomApplication.app.userBaseBean.nick_name);
        if (NewMainActivity.this.window_login != null)
          NewMainActivity.this.window_login.dismiss();
        CustomApplication.app.preferencesUtil.setValue(AppConstants.LOGIN_TOKEN, str2);
        CustomApplication.app.preferencesUtil.setValue(AppConstants.WX_NAME, paramMap.get("nickname"));
        CustomApplication.app.preferencesUtil.setValue(AppConstants.WX_OPID, paramMap.get("openid"));
        CustomApplication.app.preferencesUtil.setValue(AppConstants.WX_HEAD_IMG, paramMap.get("headimgurl"));
        CustomApplication.app.preferencesUtil.setValue(AppConstants.LOGIN_TYPE, "2");
        CustomApplication.app.preferencesUtil.setValue(AppConstants.LOGIN_USERNAME, CustomApplication.app.userBaseBean.getUser_name());
        NewMainActivity.this.initUserData();
        NewMainActivity.this.getUserAmount(NewMainActivity.this.tv_user_amount);
        NewMainActivity.this.edit_bound_username.setText("");
        NewMainActivity.this.edit_bound_psw.setText("");
      }
    });
  }

  private void chekcLogin()
  {
    String str1 = CustomApplication.app.preferencesUtil.getValue(AppConstants.LOGIN_TYPE, "1");
    if (str1.equals("1"))
    {
      this.mActionType = "1";
      autoLogin();
      return;
    }
    if (str1.equals("2"))
    {
      this.mActionType = "1";
      this.isWxDefaultLogin = true;
      HashMap localHashMap = new HashMap();
      String str2 = CustomApplication.app.preferencesUtil.getValue(AppConstants.WX_NAME, "");
      String str3 = CustomApplication.app.preferencesUtil.getValue(AppConstants.WX_OPID, "");
      String str4 = CustomApplication.app.preferencesUtil.getValue(AppConstants.WX_HEAD_IMG, "");
      localHashMap.put("nickname", str2);
      localHashMap.put("openid", str3);
      localHashMap.put("headimgurl", str4);
      wxLogin(localHashMap);
      return;
    }
    str1.equals("0");
  }

  private void doCheckUpdateDone(Float paramFloat)
  {
    try
    {
      float f = Float.parseFloat(getAppVersionCode(getApplicationContext()));
      if (f < paramFloat.floatValue())
      {
        if ((this.myUpdateDialog != null) && (this.myUpdateDialog.isShowing()))
          return;
        this.myUpdateDialog = new MyUpdateDialog(this.context);
        this.myUpdateDialog.show();
        this.myUpdateDialog.setConfirmButtonOnClickListener(new View.OnClickListener()
        {
          public void onClick(View paramAnonymousView)
          {
            NewMainActivity.this.downloadApk();
          }
        });
        LogUtils.e(this.TAG, "现版本:" + f);
        LogUtils.e(this.TAG, "服务器:" + paramFloat);
        return;
      }
    }
    catch (NumberFormatException localNumberFormatException)
    {
      localNumberFormatException.printStackTrace();
    }
  }

  private void downloadApk()
  {
    String str = DatabaseHelper.CACHE_DIR_DOWNLOAD;
    File localFile1 = new File(str);
    if (!localFile1.exists())
      localFile1.mkdir();
    final File localFile2 = new File(str, "yalebao.apk");
    LogUtils.e(this.TAG, "apk_url:" + this.apk_url);
    RequestNet.downLoadFile(this.context, this.apk_url, new FileCallBack(str, "yalebao.apk")
    {
      public void inProgress(final float paramAnonymousFloat)
      {
        LogUtils.d(NewMainActivity.this.TAG, "progress:" + 100.0F * paramAnonymousFloat);
        if ((paramAnonymousFloat <= 1.0F) && (paramAnonymousFloat >= 0.0F))
          NewMainActivity.this.runOnUiThread(new Runnable()
          {
            public void run()
            {
              NewMainActivity.this.myUpdateDialog.progress((int)(100.0F * paramAnonymousFloat));
            }
          });
      }

      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        NewMainActivity.this.myDialog1.show();
        NewMainActivity.this.myDialog1.setMessage("下载失败");
        NewMainActivity.this.myDialog1.setCancelable(false);
        NewMainActivity.this.myDialog1.btn_confirm.setOnClickListener(new View.OnClickListener()
        {
          public void onClick(View paramAnonymous2View)
          {
            CustomApplication.app.finishActivity(NewMainActivity.this);
          }
        });
      }

      public void onResponse(File paramAnonymousFile)
      {
        NewMainActivity.this.myUpdateDialog.dismiss();
        boolean bool = paramAnonymousFile.exists();
        LogUtils.e(NewMainActivity.this.TAG, "isExists:" + bool);
        if (bool)
        {
          Intent localIntent = new Intent();
          localIntent.addFlags(268435456);
          localIntent.setAction("android.intent.action.VIEW");
          localIntent.setDataAndType(Uri.fromFile(localFile2), "application/vnd.android.package-archive");
          NewMainActivity.this.startActivity(localIntent);
        }
      }
    });
  }

  public static String getAppVersionCode(Context paramContext)
  {
    try
    {
      String str = paramContext.getPackageManager().getPackageInfo(paramContext.getPackageName(), 0).versionName;
      return str;
    }
    catch (PackageManager.NameNotFoundException localNameNotFoundException)
    {
      localNameNotFoundException.printStackTrace();
    }
    return "";
  }

  private void getToken()
  {
    HashMap localHashMap = new HashMap();
    localHashMap.put("grant_type", "client_credentials");
    RequestNet.postToken(this.context, AppConstants.URL_GETTOKEN, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        LogUtils.e(NewMainActivity.this.TAG, "获取失败,getParent2RoomListInfo-result:" + paramAnonymousException);
        NewMainActivity.this.dismissLoadingDialog();
        NewMainActivity.this.setLoginBtnIsEnable(true);
        NewMainActivity.this.setRegisterBtnIsEnable(true);
        NewMainActivity.this.setLoginBtnIsEnable(true);
        if (NewMainActivity.this.mActionType.equals("0"))
          UiUtil.showToast(NewMainActivity.this.context, "登录失败");
        do
        {
          do
            return;
          while (NewMainActivity.this.mActionType.equals("1"));
          if (NewMainActivity.this.mActionType.equals("2"))
          {
            UiUtil.showToast(NewMainActivity.this.context, "登录失败");
            return;
          }
        }
        while (!NewMainActivity.this.mActionType.equals("3"));
        UiUtil.showToast(NewMainActivity.this.context, "注册失败");
      }

      public void onResponse(String paramAnonymousString)
      {
        Gson localGson = new Gson();
        do
        {
          TokenModel localTokenModel;
          do
            try
            {
              localTokenModel = (TokenModel)localGson.fromJson(paramAnonymousString, TokenModel.class);
              if (localTokenModel == null)
              {
                LogUtils.e(NewMainActivity.this.TAG, "获取失败");
                NewMainActivity.this.dismissLoadingDialog();
                NewMainActivity.this.setLoginBtnIsEnable(true);
                NewMainActivity.this.setRegisterBtnIsEnable(true);
                NewMainActivity.this.setLoginBtnIsEnable(true);
                if (NewMainActivity.this.mActionType.equals("0"))
                {
                  UiUtil.showToast(NewMainActivity.this.context, "登录失败");
                  return;
                }
              }
            }
            catch (Exception localException)
            {
              do
              {
                do
                  while (true)
                  {
                    localException.printStackTrace();
                    localTokenModel = null;
                  }
                while (NewMainActivity.this.mActionType.equals("1"));
                if (NewMainActivity.this.mActionType.equals("2"))
                {
                  UiUtil.showToast(NewMainActivity.this.context, "登录失败");
                  return;
                }
              }
              while (!NewMainActivity.this.mActionType.equals("3"));
              UiUtil.showToast(NewMainActivity.this.context, "注册失败");
              return;
            }
          while (localTokenModel == null);
          AppConstants.NO_LOGIN_TOKEN = localTokenModel.getAccess_token();
          if (NewMainActivity.this.mActionType.equals("1"))
          {
            NewMainActivity.this.chekcLogin();
            return;
          }
          if (NewMainActivity.this.mActionType.equals("0"))
          {
            NewMainActivity.this.goLogin();
            return;
          }
          if (NewMainActivity.this.mActionType.equals("2"))
          {
            NewMainActivity.this.weixinBut();
            return;
          }
        }
        while (!NewMainActivity.this.mActionType.equals("3"));
        NewMainActivity.this.goRegister();
      }
    });
  }

  private void getTopMessage()
  {
    HashMap localHashMap = new HashMap();
    localHashMap.put("guid", this.guid);
    localHashMap.put("type", "5");
    LogUtils.e(this.TAG, "---guid:" + this.guid);
    LogUtils.d(this.TAG, "URL:" + AppConstants.URL_GETTOPMESSAGE);
    RequestNet.get(this.context, AppConstants.URL_GETTOPMESSAGE, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        LogUtils.e(NewMainActivity.this.TAG, "获取失败,getTopMessage-result:" + paramAnonymousException);
      }

      public void onResponse(String paramAnonymousString)
      {
        LogUtils.d(NewMainActivity.this.TAG, "-------getTopMessage:" + paramAnonymousString);
        Gson localGson = new Gson();
        try
        {
          localGetTopMessageBean = (GetTopMessageBean)localGson.fromJson(paramAnonymousString, GetTopMessageBean.class);
          if (localGetTopMessageBean == null)
            return;
        }
        catch (Exception localException)
        {
          GetTopMessageBean localGetTopMessageBean;
          String str;
          SharedPreferences localSharedPreferences;
          do
          {
            do
            {
              do
              {
                while (true)
                {
                  localException.printStackTrace();
                  localGetTopMessageBean = null;
                }
                if (localGetTopMessageBean.getFlag() == -4)
                {
                  NewMainActivity.activityStack.backToMain(NewMainActivity.class, NewMainActivity.this);
                  return;
                }
              }
              while (localGetTopMessageBean.getFlag() == 0);
              if (localGetTopMessageBean.getFlag() == -2)
              {
                NewMainActivity.this.showDownWireDialog();
                return;
              }
              if (localGetTopMessageBean.getFlag() == -3)
              {
                NewMainActivity.this.ShowFengjinDialog();
                return;
              }
            }
            while (localGetTopMessageBean.getFlag() != 1);
            str = localGetTopMessageBean.getCtype();
            localSharedPreferences = NewMainActivity.this.getSharedPreferences("syatemmessage", 0);
          }
          while (localSharedPreferences.getString("id", "").equals(str));
          final SystemnotificationDialog localSystemnotificationDialog = new SystemnotificationDialog(NewMainActivity.this.context);
          localSystemnotificationDialog.tv_tishi1.setText(localGetTopMessageBean.getTitle());
          localSystemnotificationDialog.tv_tishi2.setText(localGetTopMessageBean.getIntro());
          String[] arrayOfString = localGetTopMessageBean.getDate().split(" ");
          localSystemnotificationDialog.tv_tishi3.setText(arrayOfString[0]);
          if (!localSystemnotificationDialog.isShowing())
            localSystemnotificationDialog.show();
          localSystemnotificationDialog.btn_confirm.setOnClickListener(new View.OnClickListener()
          {
            public void onClick(View paramAnonymous2View)
            {
              localSystemnotificationDialog.dismiss();
            }
          });
          SharedPreferences.Editor localEditor = localSharedPreferences.edit();
          localEditor.putString("id", str);
          localEditor.commit();
        }
      }
    });
  }

  private void getUserAmount(final TextView paramTextView)
  {
    getHasNoRead(this.iv_msg_number);
    paramTextView.setText("获取中...");
    HashMap localHashMap = new HashMap();
    localHashMap.put("guid", this.guid);
    LogUtils.d(this.TAG, "guid:" + this.guid);
    LogUtils.d(this.TAG, "URL:" + AppConstants.URL_GET_USER_AMOUNT);
    RequestNet.get(this.context, AppConstants.URL_GET_USER_AMOUNT, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        LogUtils.e(NewMainActivity.this.TAG, "获取失败,getUserAmount-result:" + paramAnonymousException);
      }

      public void onResponse(String paramAnonymousString)
      {
        LogUtils.d(NewMainActivity.this.TAG, "result:" + paramAnonymousString);
        Gson localGson = new Gson();
        String str;
        try
        {
          localBaseDataObject = (BaseDataObject)localGson.fromJson(paramAnonymousString, BaseDataObject.class);
          if (localBaseDataObject == null)
            return;
        }
        catch (Exception localException)
        {
          BaseDataObject localBaseDataObject;
          do
          {
            while (true)
            {
              localException.printStackTrace();
              localBaseDataObject = null;
            }
            if (localBaseDataObject.getFlag() == -4)
            {
              NewMainActivity.activityStack.backToMain(NewMainActivity.class, NewMainActivity.this);
              return;
            }
            if (localBaseDataObject.getFlag() == 0)
            {
              UiUtil.showToast(NewMainActivity.this.context, localBaseDataObject.getMsg());
              return;
            }
            if (localBaseDataObject.getFlag() == -2)
            {
              NewMainActivity.this.showDownWireDialog();
              return;
            }
            if (localBaseDataObject.getFlag() == -3)
            {
              NewMainActivity.this.ShowFengjinDialog();
              return;
            }
          }
          while (localBaseDataObject.getFlag() != 1);
          str = localBaseDataObject.getResult();
          if (str == null);
        }
        try
        {
          CustomApplication.app.userAmount = Double.parseDouble(str);
          LogUtils.d("获取成功", "getUserAmount()-result:" + str);
          paramTextView.setText(str);
          return;
        }
        catch (NumberFormatException localNumberFormatException)
        {
          while (true)
            localNumberFormatException.printStackTrace();
        }
      }
    });
  }

  private void goLogin()
  {
    this.userName = this.edit_login_username.getText().toString();
    this.userPsw = this.edit_login_psw.getText().toString();
    if ("".equals(this.userName))
    {
      UiUtil.showToast(this.context, "请输入您的账号");
      this.edit_login_username.requestFocus();
      return;
    }
    if ("".equals(this.userPsw))
    {
      UiUtil.showToast(this.context, "请输入您的密码");
      this.edit_login_username.requestFocus();
      return;
    }
    HashMap localHashMap = new HashMap();
    localHashMap.put("user_name", this.userName);
    localHashMap.put("password", this.userPsw);
    localHashMap.put("client_type", "1");
    localHashMap.put("client_Id", CustomApplication.app.IMEI);
    localHashMap.put("Client_Ip", CustomApplication.app.NetIP);
    LogUtils.d(this.TAG, "userName:" + this.userName);
    LogUtils.d(this.TAG, "userPsw:" + this.userPsw);
    LogUtils.d(this.TAG, "AppConstants.NO_LOGIN_TOKEN:" + AppConstants.NO_LOGIN_TOKEN);
    showLoadingDialog();
    setLoginBtnIsEnable(false);
    this.mActionType = "0";
    if (AppConstants.NO_LOGIN_TOKEN.equals(""))
    {
      getToken();
      return;
    }
    RequestNet.post(this.context, AppConstants.URL_LOGIN, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        Log.e(NewMainActivity.this.TAG, "登陆失败,login-result:" + paramAnonymousException);
        UiUtil.showToast(NewMainActivity.this.context, "登陆失败");
        NewMainActivity.this.dismissLoadingDialog();
        NewMainActivity.this.setLoginBtnIsEnable(true);
      }

      public void onResponse(String paramAnonymousString)
      {
        NewMainActivity.this.setLoginBtnIsEnable(true);
        NewMainActivity.this.dismissLoadingDialog();
        if (paramAnonymousString.isEmpty());
        do
        {
          return;
          Gson localGson = new Gson();
          try
          {
            localUserBean = (UserBean)localGson.fromJson(paramAnonymousString, UserBean.class);
            if (localUserBean == null)
            {
              UiUtil.showToast(NewMainActivity.this.context, "登陆失败");
              return;
            }
          }
          catch (Exception localException)
          {
            UserBean localUserBean;
            while (true)
            {
              localException.printStackTrace();
              localUserBean = null;
            }
            if (localUserBean.getFlag() == -4)
            {
              NewMainActivity.activityStack.backToMain(NewMainActivity.class, NewMainActivity.this);
              return;
            }
            LogUtils.e(NewMainActivity.this.TAG, "s:  " + paramAnonymousString);
            CustomApplication.app.userBaseBean = localUserBean.getResult();
            if (localUserBean.getFlag() != 1)
            {
              NewMainActivity.this.ShowDialog1(localUserBean.getMsg());
              return;
            }
          }
        }
        while (CustomApplication.app.userBaseBean == null);
        LogUtils.i(NewMainActivity.this.TAG, "登陆成功");
        CustomApplication.app.isLogin = true;
        String str1 = CustomApplication.app.userBaseBean.getGuid();
        String str2 = CustomApplication.app.userBaseBean.getAccessToken();
        if ((NewMainActivity.this.dongtaiFragment != null) && (CustomApplication.app.isLogin))
          NewMainActivity.this.dongtaiFragment.getDataFromServer();
        LogUtils.d(NewMainActivity.this.TAG, "guid：" + str1);
        LogUtils.d(NewMainActivity.this.TAG, "accessToken：" + str2);
        LogUtils.d(NewMainActivity.this.TAG, "memberId：" + CustomApplication.app.userBaseBean.getMemberid());
        LogUtils.d(NewMainActivity.this.TAG, "SessionToken：" + CustomApplication.app.userBaseBean.getSessionToken());
        LogUtils.d(NewMainActivity.this.TAG, "IsRoomOwner：" + CustomApplication.app.userBaseBean.IsRoomOwner);
        LogUtils.d(NewMainActivity.this.TAG, "nick_name：" + CustomApplication.app.userBaseBean.nick_name);
        if (NewMainActivity.this.window_login != null)
          NewMainActivity.this.window_login.dismiss();
        CustomApplication.app.preferencesUtil.setValue(AppConstants.LOGIN_TOKEN, str2);
        CustomApplication.app.preferencesUtil.setValue(AppConstants.LOGIN_USERNAME, NewMainActivity.this.userName);
        CustomApplication.app.preferencesUtil.setValue(AppConstants.LOGIN_PWD, NewMainActivity.this.userPsw);
        CustomApplication.app.preferencesUtil.setValue(AppConstants.LOGIN_TYPE, "1");
        NewMainActivity.this.initUserData();
        NewMainActivity.this.getUserAmount(NewMainActivity.this.tv_user_amount);
      }
    });
  }

  private void goRegister()
  {
    this.registerUserName = this.edit_register_username.getText().toString();
    this.registerUserPsw = this.edit_register_psw.getText().toString();
    this.registerUserPswRp = this.edit_register_rppsw.getText().toString();
    this.registerNickName = this.edit_register_nickname.getText().toString();
    this.registerIntroduceId = this.edit_register_introduce.getText().toString();
    if ("".equals(this.registerUserName))
    {
      this.tv_user_name_tishi.setText("请输入您的账号");
      this.edit_register_username.requestFocus();
      this.scroll_register.fullScroll(33);
      return;
    }
    if (!UiUtil.isValidUserName(this.registerUserName))
    {
      this.tv_user_name_tishi.setText("账号需要6~12位字母或数字");
      this.edit_register_username.requestFocus();
      return;
    }
    if ("".equals(this.registerUserPsw))
    {
      this.tv_user_psw_tishi.setText("请输入您的密码");
      this.edit_register_psw.requestFocus();
      return;
    }
    if (this.registerUserName.equals(this.registerUserPsw))
    {
      this.tv_user_psw_tishi.setText("账号和密码不能一致");
      this.edit_register_psw.requestFocus();
      return;
    }
    if (!this.registerUserPsw.equals(this.registerUserPswRp))
    {
      this.tv_user_con_psw_tishi.setText("两次密码不一致");
      this.edit_register_rppsw.requestFocus();
      return;
    }
    if ("".equals(this.registerIntroduceId))
      this.registerIntroduceId = "0";
    if (!this.ck_xieyi.isChecked())
    {
      ShowDialog1("请阅读并同意《注册协议》");
      return;
    }
    this.tv_user_name_tishi.setText("");
    this.tv_user_psw_tishi.setText("");
    this.tv_user_con_psw_tishi.setText("");
    this.tv_user_nick_name_tishi.setText("");
    HashMap localHashMap = new HashMap();
    localHashMap.put("nick_name", this.registerNickName);
    localHashMap.put("user_name", this.registerUserName);
    localHashMap.put("password", this.registerUserPsw);
    localHashMap.put("pid", this.registerIntroduceId);
    this.mActionType = "3";
    showLoadingDialog();
    setRegisterBtnIsEnable(false);
    if (AppConstants.NO_LOGIN_TOKEN.equals(""))
    {
      getToken();
      return;
    }
    RequestNet.get(this.context, AppConstants.URL_REGISTER, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        LogUtils.e("注册失败", "register-result:" + paramAnonymousException);
        UiUtil.showToast(NewMainActivity.this.context, "注册失败");
        NewMainActivity.this.setRegisterBtnIsEnable(true);
      }

      public void onResponse(String paramAnonymousString)
      {
        NewMainActivity.this.dismissLoadingDialog();
        NewMainActivity.this.setRegisterBtnIsEnable(true);
        if (paramAnonymousString.isEmpty());
        BaseDataObject localBaseDataObject;
        while (true)
        {
          return;
          Gson localGson = new Gson();
          try
          {
            localBaseDataObject = (BaseDataObject)localGson.fromJson(paramAnonymousString, BaseDataObject.class);
            if (localBaseDataObject != null)
              if (localBaseDataObject.getFlag() != 1)
              {
                NewMainActivity.this.ShowDialog1(localBaseDataObject.getMsg());
                return;
              }
          }
          catch (Exception localException)
          {
            while (true)
            {
              localException.printStackTrace();
              localBaseDataObject = null;
            }
          }
        }
        if (!"".equals(localBaseDataObject.getMsg()))
        {
          LogUtils.d("注册成功", "register-result:" + paramAnonymousString);
          String[] arrayOfString1 = "恭喜成为pcdd会员,您可添加VIP专属客服微信: pcddmm 尊享贵宾服务".trim().split(":");
          if (arrayOfString1.length != 2)
            break label542;
          String[] arrayOfString2 = arrayOfString1[1].split(" 尊");
          if (arrayOfString2.length != 2)
            break label495;
          Spanned localSpanned = Html.fromHtml(new StringBuilder(String.valueOf(new StringBuilder("<font color='#333333'>").append(arrayOfString1[0]).append(": </font>").toString())).append("<font color='#3b85ff'>").append(arrayOfString2[0]).append("</font>").toString() + " 尊<font color='#333333'>" + arrayOfString2[1] + "</font>");
          NewMainActivity.this.myDialog1.tv_tishi.setText(localSpanned);
          NewMainActivity.this.myDialog1.tv_tishi.setMovementMethod(LinkMovementMethod.getInstance());
        }
        while (true)
        {
          NewMainActivity.this.myDialog1.show();
          NewMainActivity.this.myDialog1.btn_confirm.setOnClickListener(new View.OnClickListener()
          {
            public void onClick(View paramAnonymous2View)
            {
              NewMainActivity.this.myDialog1.dismiss();
            }
          });
          NewMainActivity.this.window_register.dismiss();
          NewMainActivity.this.userName = NewMainActivity.this.registerUserName;
          NewMainActivity.this.userPsw = NewMainActivity.this.registerUserPsw;
          CustomApplication.app.preferencesUtil.setValue(AppConstants.LOGIN_USERNAME, NewMainActivity.this.registerUserName);
          CustomApplication.app.preferencesUtil.setValue(AppConstants.LOGIN_PWD, NewMainActivity.this.registerUserPsw);
          NewMainActivity.this.closeWindowSoftInput(NewMainActivity.this.getCurrentFocus());
          NewMainActivity.this.edit_login_username.setText(NewMainActivity.this.registerUserName);
          NewMainActivity.this.edit_login_psw.setText(NewMainActivity.this.registerUserPsw);
          NewMainActivity.this.edit_register_username.setText("");
          NewMainActivity.this.edit_register_psw.setText("");
          NewMainActivity.this.edit_register_rppsw.setText("");
          NewMainActivity.this.edit_register_nickname.setText("");
          NewMainActivity.this.edit_register_introduce.setText("");
          NewMainActivity.this.goLogin();
          return;
          label495: NewMainActivity.this.myDialog1.tv_tishi.setText("恭喜成为pcdd会员,您可添加VIP专属客服微信: pcddmm 尊享贵宾服务");
          NewMainActivity.this.myDialog1.tv_tishi.setTextColor(NewMainActivity.this.context.getResources().getColor(2131165335));
          continue;
          label542: NewMainActivity.this.myDialog1.tv_tishi.setText("恭喜成为pcdd会员,您可添加VIP专属客服微信: pcddmm 尊享贵宾服务");
          NewMainActivity.this.myDialog1.tv_tishi.setTextColor(NewMainActivity.this.context.getResources().getColor(2131165335));
        }
      }
    });
  }

  private void initOtherLogin()
  {
    ShareSDK.initSDK(this);
  }

  private void initUserData()
  {
    if (CustomApplication.app.userBaseBean != null)
    {
      this.userNickName = CustomApplication.app.userBaseBean.getNick_name();
      this.geQian = CustomApplication.app.userBaseBean.getSignature();
      this.imgPartUrl = CustomApplication.app.userBaseBean.getUser_logo();
      this.guid = CustomApplication.app.userBaseBean.getGuid();
      this.imgPartUrl = CustomApplication.app.userBaseBean.getUser_logo();
    }
    LogUtils.e(this.TAG, "userNickName:" + this.userNickName);
    LogUtils.e(this.TAG, "geQian:" + this.geQian);
    LogUtils.e(this.TAG, "imgPartUrl:" + this.imgPartUrl);
    LogUtils.e(this.TAG, "guid:" + this.guid);
  }

  private void login(final String paramString)
  {
    LoginApi localLoginApi = new LoginApi();
    localLoginApi.setPlatform(paramString);
    localLoginApi.setOnLoginListener(new OnLoginListener()
    {
      public void cancle()
      {
        NewMainActivity.this.dismissLoadingDialog();
        NewMainActivity.this.wx_login_view.setEnabled(true);
        NewMainActivity.this.qq_login_view.setEnabled(true);
      }

      public boolean onLogin(String paramAnonymousString, HashMap<String, Object> paramAnonymousHashMap)
      {
        NewMainActivity.this.wx_login_view.setEnabled(false);
        if (paramString.equals(Wechat.NAME))
        {
          NewMainActivity.this.weixinMap = paramAnonymousHashMap;
          NewMainActivity.this.wxLogin(paramAnonymousHashMap);
        }
        while (true)
        {
          return true;
          paramString.equals(QQ.NAME);
        }
      }

      public boolean onRegister(UserInfo paramAnonymousUserInfo)
      {
        return true;
      }
    });
    localLoginApi.login(this);
  }

  private void newLogin(final Map<String, Object> paramMap)
  {
    HashMap localHashMap = new HashMap();
    localHashMap.put("nickname", paramMap.get("nickname"));
    localHashMap.put("open_id", paramMap.get("openid"));
    localHashMap.put("headimgurl", paramMap.get("headimgurl"));
    localHashMap.put("client_type", "1");
    localHashMap.put("client_Id", CustomApplication.app.IMEI);
    localHashMap.put("login_type", "1");
    showLoadingDialog();
    RequestNet.get(this.context, AppConstants.URL_GET_NEWWEXINLOGIN, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        Log.e(NewMainActivity.this.TAG, "登陆失败,login-result:" + paramAnonymousException);
        NewMainActivity.this.dismissLoadingDialog();
        NewMainActivity.this.img_new_user.setEnabled(true);
      }

      public void onResponse(String paramAnonymousString)
      {
        NewMainActivity.this.img_new_user.setEnabled(true);
        NewMainActivity.this.dismissLoadingDialog();
        if (paramAnonymousString.isEmpty());
        UserBean localUserBean;
        do
        {
          return;
          Gson localGson = new Gson();
          try
          {
            localUserBean = (UserBean)localGson.fromJson(paramAnonymousString, UserBean.class);
            if (localUserBean == null)
            {
              UiUtil.showToast(NewMainActivity.this.context, "登陆失败");
              return;
            }
          }
          catch (Exception localException)
          {
            while (true)
            {
              localException.printStackTrace();
              localUserBean = null;
            }
            if (localUserBean.getFlag() == -4)
            {
              NewMainActivity.activityStack.backToMain(NewMainActivity.class, NewMainActivity.this);
              return;
            }
            LogUtils.e(NewMainActivity.this.TAG, "s:  " + paramAnonymousString);
            CustomApplication.app.userBaseBean = localUserBean.getResult();
            if (localUserBean.getFlag() == 0)
              NewMainActivity.this.ShowDialog1(localUserBean.getMsg());
          }
        }
        while ((localUserBean.getFlag() != 1) || (CustomApplication.app.userBaseBean == null));
        LogUtils.i(NewMainActivity.this.TAG, "登陆成功");
        CustomApplication.app.isLogin = true;
        UiUtil.showToast(NewMainActivity.this.context, "登录成功");
        String str1 = CustomApplication.app.userBaseBean.getGuid();
        String str2 = CustomApplication.app.userBaseBean.getAccessToken();
        LogUtils.d(NewMainActivity.this.TAG, "guid：" + str1);
        LogUtils.d(NewMainActivity.this.TAG, "accessToken：" + str2);
        LogUtils.d(NewMainActivity.this.TAG, "memberId：" + CustomApplication.app.userBaseBean.getMemberid());
        LogUtils.d(NewMainActivity.this.TAG, "SessionToken：" + CustomApplication.app.userBaseBean.getSessionToken());
        LogUtils.d(NewMainActivity.this.TAG, "IsRoomOwner：" + CustomApplication.app.userBaseBean.IsRoomOwner);
        LogUtils.d(NewMainActivity.this.TAG, "nick_name：" + CustomApplication.app.userBaseBean.nick_name);
        if (NewMainActivity.this.window_login != null)
          NewMainActivity.this.window_login.dismiss();
        CustomApplication.app.preferencesUtil.setValue(AppConstants.LOGIN_TOKEN, str2);
        CustomApplication.app.preferencesUtil.setValue(AppConstants.WX_NAME, paramMap.get("nickname"));
        CustomApplication.app.preferencesUtil.setValue(AppConstants.WX_OPID, paramMap.get("openid"));
        CustomApplication.app.preferencesUtil.setValue(AppConstants.WX_HEAD_IMG, paramMap.get("headimgurl"));
        CustomApplication.app.preferencesUtil.setValue(AppConstants.LOGIN_TYPE, "2");
        CustomApplication.app.preferencesUtil.setValue(AppConstants.LOGIN_USERNAME, CustomApplication.app.userBaseBean.getUser_name());
        NewMainActivity.this.initUserData();
        NewMainActivity.this.getUserAmount(NewMainActivity.this.tv_user_amount);
        NewMainActivity.this.selectPopupWindow.dismiss();
      }
    });
  }

  private void registerNetReceiver()
  {
    this.receiverNet = new MyReceiver();
    IntentFilter localIntentFilter = new IntentFilter();
    localIntentFilter.addAction("android.net.conn.CONNECTIVITY_CHANGE");
    localIntentFilter.setPriority(1000);
    registerReceiver(this.receiverNet, localIntentFilter);
    System.out.println("【IndexFrament-网络监听】广播已经注册");
  }

  private void sendUserPhoto(Bitmap paramBitmap)
  {
    HashMap localHashMap = new HashMap();
    localHashMap.put("guid", CustomApplication.app.userBaseBean.getGuid());
    localHashMap.put("base64", FileTools.Bitmap2StrByBase64(paramBitmap));
    RequestNet.post(this.context, AppConstants.URL_POST_USER_PIC, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        LogUtils.e("返回失败", "sendUserPhoto-result:" + paramAnonymousException);
      }

      public void onResponse(String paramAnonymousString)
      {
        LogUtils.d("返回成功", "result:" + paramAnonymousString);
        Gson localGson = new Gson();
        try
        {
          localUserBean = (UserBean)localGson.fromJson(paramAnonymousString, UserBean.class);
          if (localUserBean == null)
          {
            UiUtil.showToast(NewMainActivity.this.context, "上传头像失败");
            return;
          }
        }
        catch (Exception localException)
        {
          String str2;
          do
          {
            String str1;
            do
            {
              do
              {
                UserBean localUserBean;
                while (true)
                {
                  localException.printStackTrace();
                  localUserBean = null;
                }
                if (localUserBean.getFlag() == -4)
                {
                  NewMainActivity.activityStack.backToMain(NewMainActivity.class, NewMainActivity.this);
                  return;
                }
                if (localUserBean.getFlag() != 1)
                {
                  UiUtil.showToast(NewMainActivity.this.context, localUserBean.getMsg());
                  return;
                }
                if (CustomApplication.app.userBaseBean != null)
                  CustomApplication.app.userBaseBean.user_logo = localUserBean.getResult().user_logo;
              }
              while (CustomApplication.app.userBaseBean == null);
              UiUtil.showToast(NewMainActivity.this.context, "上传头像成功");
              str1 = CustomApplication.app.userBaseBean.getUser_logo();
              LogUtils.d(NewMainActivity.this.TAG, "imgPartUrl:" + str1);
            }
            while ((str1 == null) || ("".equals(str1)));
            str2 = AppConstants.BASE_URL_IMG + str1;
            LogUtils.d(NewMainActivity.this.TAG, "imgFullUrl:" + str2);
          }
          while (MineFragment.fragment == null);
          UiUtil.loadRoundImage(str2, NewMainActivity.this.context, MineFragment.fragment.img_photo);
        }
      }
    });
  }

  private void setButtonColor(int paramInt)
  {
    int i = 0;
    int j;
    int k;
    if (i >= this.containerIds.length)
    {
      j = 0;
      if (j >= this.bottomBtnIds.length)
      {
        k = 0;
        if (k < mLinList.length)
          break label142;
      }
    }
    else
    {
      if (paramInt == i)
        this.containers[i].setVisibility(0);
      while (true)
      {
        i++;
        break;
        this.containers[i].setVisibility(8);
      }
    }
    if (paramInt == j)
    {
      mLinList[j].setSelected(true);
      this.mBtnList[j].setSelected(true);
      this.mTvList[j].setSelected(true);
    }
    while (true)
    {
      j++;
      break;
      mLinList[j].setSelected(false);
      this.mBtnList[j].setSelected(false);
      this.mTvList[j].setSelected(false);
    }
    label142: if (paramInt == k)
      mLinList[k].setClickable(false);
    while (true)
    {
      k++;
      break;
      mLinList[k].setClickable(true);
    }
  }

  private void setLoginBtnIsEnable(boolean paramBoolean)
  {
    if (paramBoolean)
      this.img_login.setBackgroundResource(2130837557);
    while (true)
    {
      this.img_login.setEnabled(paramBoolean);
      return;
      this.img_login.setBackgroundResource(2130837754);
    }
  }

  private void setRegisterBtnIsEnable(boolean paramBoolean)
  {
    if (paramBoolean)
      this.img_register.setBackgroundResource(2130837572);
    while (true)
    {
      this.img_register.setEnabled(paramBoolean);
      return;
      this.img_register.setBackgroundResource(2130838119);
    }
  }

  private void setWxBtnIsEnable(boolean paramBoolean)
  {
    this.wx_login_view.setEnabled(paramBoolean);
    if (paramBoolean)
    {
      this.wx_login_view.setBackgroundResource(2130837761);
      return;
    }
    this.wx_login_view.setBackgroundResource(2130837763);
  }

  private void showLoginPopwindow()
  {
    this.viewLogin.bringToFront();
    (9 * (CustomApplication.app.displayMetrics.widthPixels / 10));
    if (this.window_login == null)
      this.window_login = new PopupWindow(this.viewLogin, -1, -1);
    this.window_login.setFocusable(true);
    ImageView localImageView = (ImageView)this.viewLogin.findViewById(2131100198);
    localImageView.bringToFront();
    localImageView.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NewMainActivity.this.window_login.dismiss();
      }
    });
    this.userName = CustomApplication.app.preferencesUtil.getValue(AppConstants.LOGIN_USERNAME, this.userName);
    this.userPsw = CustomApplication.app.preferencesUtil.getValue(AppConstants.LOGIN_PWD, this.userPsw);
    LogUtils.i(this.TAG, "showLoginPopwindow()-userPsw:" + this.userPsw);
    this.edit_login_username.setText(this.userName);
    this.edit_login_psw.setText(this.userPsw);
    this.window_login.setSoftInputMode(16);
    this.img_login.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NewMainActivity.this.closeWindowSoftInput(NewMainActivity.this.getCurrentFocus());
        AppConstants.NO_LOGIN_TOKEN = "";
        NewMainActivity.this.goLogin();
      }
    });
    this.wx_login_view.setEnabled(true);
    this.wx_login_view.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NewMainActivity.this.isWxDefaultLogin = false;
        NewMainActivity.this.showLoadingDialog();
        NewMainActivity.this.mActionType = "2";
        NewMainActivity.this.getToken();
      }
    });
    this.qq_login_view.setEnabled(true);
    this.qq_login_view.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        UiUtil.showToast(NewMainActivity.this, "暂未开放");
      }
    });
    this.window_login.setBackgroundDrawable(this.context.getResources().getDrawable(2130837534));
    this.window_login.setAnimationStyle(2131361795);
    this.window_login.showAtLocation(this.contentView, 17, 0, 60);
    this.window_login.setOnDismissListener(new PopupWindow.OnDismissListener()
    {
      public void onDismiss()
      {
      }
    });
  }

  private void showOldUserPopwindow()
  {
    this.olduserpop.bringToFront();
    (9 * (CustomApplication.app.displayMetrics.widthPixels / 10));
    if (this.old_userpop == null)
      this.old_userpop = new PopupWindow(this.olduserpop, -1, -1);
    this.old_userpop.setFocusable(true);
    this.edit_bound_username = ((EditText)this.olduserpop.findViewById(2131100213));
    this.edit_bound_psw = ((EditText)this.olduserpop.findViewById(2131100214));
    this.edit_bound_username.setText("");
    this.edit_bound_psw.setText("");
    this.img_bound_sure = ((ImageView)this.olduserpop.findViewById(2131100215));
    this.img_bound_close = ((ImageView)this.olduserpop.findViewById(2131100216));
    this.img_bound_close.bringToFront();
    this.img_bound_close.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NewMainActivity.this.old_userpop.dismiss();
      }
    });
    this.old_userpop.setSoftInputMode(16);
    this.img_bound_sure.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NewMainActivity.this.img_bound_sure.setEnabled(false);
        NewMainActivity.this.closeWindowSoftInput(NewMainActivity.this.getCurrentFocus());
        NewMainActivity.this.bindUserAction(NewMainActivity.this.weixinMap);
      }
    });
    this.old_userpop.setBackgroundDrawable(this.context.getResources().getDrawable(2130837534));
    this.old_userpop.setAnimationStyle(2131361795);
    this.old_userpop.showAtLocation(this.contentView, 17, 0, 60);
    this.old_userpop.setOnDismissListener(new PopupWindow.OnDismissListener()
    {
      public void onDismiss()
      {
      }
    });
  }

  @SuppressLint({"NewApi"})
  @TargetApi(12)
  private void showPopwindow()
  {
    if (CustomApplication.app.isLogin)
    {
      initUserData();
      getUserAmount(this.tv_user_amount);
    }
    getHasNoRead(this.iv_msg_number);
    this.button1 = ((ImageButton)this.viewLeft.findViewById(2131099743));
    this.button2 = ((ImageButton)this.viewLeft.findViewById(2131100302));
    this.tv_user_amount = ((TextView)this.viewLeft.findViewById(2131100303));
    this.iv_msg_number = ((ImageView)this.viewLeft.findViewById(2131100306));
    RoundImageView localRoundImageView = (RoundImageView)this.viewLeft.findViewById(2131100043);
    TextView localTextView1 = (TextView)this.viewLeft.findViewById(2131100071);
    if (this.userNickName != null)
    {
      localTextView1.setText(this.userNickName);
      if ((this.imgPartUrl == null) || ("".equals(this.imgPartUrl)))
        break label528;
      UiUtil.loadRoundImage(AppConstants.BASE_URL_IMG + this.imgPartUrl, this.context, localRoundImageView);
    }
    while (true)
    {
      ((LinearLayout)this.viewLeft.findViewById(2131100304)).setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          NewMainActivity.this.startActivity(new Intent(NewMainActivity.this, QianBaoActivity.class));
        }
      });
      ((LinearLayout)this.viewLeft.findViewById(2131100305)).setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          if (NoDoubleClickUtils.isDoubleClick())
            return;
          NewMainActivity.this.startActivity(new Intent(NewMainActivity.this, MyMessageActivity.class));
        }
      });
      this.button1.setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          if (NoDoubleClickUtils.isDoubleClick())
            return;
          NewMainActivity.this.startActivity(new Intent(NewMainActivity.this, ChongzhiActivity.class));
        }
      });
      this.button2.setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          NewMainActivity.this.Isboundphone();
        }
      });
      this.popWindowLeft = new PopupWindow(this.viewLeft, -1, -2);
      this.popWindowLeft.setFocusable(true);
      this.popWindowLeft.setOutsideTouchable(true);
      this.popWindowLeft.setAnimationStyle(2131361794);
      this.popWindowLeft.showAtLocation(findViewById(2131099699), 48, 0, 0);
      ImageView localImageView1 = (ImageView)this.viewLeft.findViewById(2131100310);
      RelativeLayout localRelativeLayout = (RelativeLayout)this.viewLeft.findViewById(2131100300);
      localImageView1.setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          if (NewMainActivity.this.popWindowLeft.isShowing())
            NewMainActivity.this.popWindowLeft.dismiss();
        }
      });
      final ImageView localImageView2 = (ImageView)this.viewLeft.findViewById(2131100301);
      localImageView2.setImageResource(2130838159);
      localImageView2.setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          NewMainActivity.this.popWindowLeft.dismiss();
        }
      });
      final TextView localTextView2 = (TextView)this.viewLeft.findViewById(2131100308);
      localTextView2.setText(this.featherStr[this.featherIndex]);
      ((ImageView)this.viewLeft.findViewById(2131100307)).setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          NewMainActivity localNewMainActivity = NewMainActivity.this;
          localNewMainActivity.featherIndex = (-1 + localNewMainActivity.featherIndex);
          if (NewMainActivity.this.featherIndex < 0)
          {
            NewMainActivity.this.featherIndex = (-1 + NewMainActivity.this.featherStr.length);
            localTextView2.setText(NewMainActivity.this.featherStr[NewMainActivity.this.featherIndex]);
            return;
          }
          localTextView2.setText(NewMainActivity.this.featherStr[NewMainActivity.this.featherIndex]);
        }
      });
      ((ImageView)this.viewLeft.findViewById(2131100309)).setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          NewMainActivity localNewMainActivity = NewMainActivity.this;
          localNewMainActivity.featherIndex = (1 + localNewMainActivity.featherIndex);
          if (NewMainActivity.this.featherIndex > -1 + NewMainActivity.this.featherStr.length)
          {
            NewMainActivity.this.featherIndex = 0;
            localTextView2.setText(NewMainActivity.this.featherStr[NewMainActivity.this.featherIndex]);
            return;
          }
          localTextView2.setText(NewMainActivity.this.featherStr[NewMainActivity.this.featherIndex]);
        }
      });
      localRelativeLayout.setOnTouchListener(new MyGestureListener());
      this.popWindowLeft.setOnDismissListener(new PopupWindow.OnDismissListener()
      {
        public void onDismiss()
        {
          localImageView2.setImageResource(2130838158);
          System.out.println("popWindowLeft消失");
        }
      });
      return;
      localTextView1.setText("");
      break;
      label528: localRoundImageView.setImageResource(2130838020);
    }
  }

  private void showRegisterPopwindow()
  {
    if (this.window_login.isShowing())
      this.window_login.dismiss();
    this.viewRegister.bringToFront();
    this.scroll_register = ((ScrollView)this.viewRegister.findViewById(2131100190));
    (4 * CustomApplication.app.displayMetrics.widthPixels / 3);
    if (this.window_register == null)
      this.window_register = new PopupWindow(this.viewRegister, -1, -1);
    this.window_register.setFocusable(true);
    this.window_register.setOutsideTouchable(true);
    ImageView localImageView = (ImageView)this.viewRegister.findViewById(2131100198);
    localImageView.bringToFront();
    localImageView.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NewMainActivity.this.window_register.dismiss();
        NewMainActivity.this.showLoginPop();
      }
    });
    this.tv_user_name_tishi = ((TextView)this.viewRegister.findViewById(2131100199));
    this.tv_user_psw_tishi = ((TextView)this.viewRegister.findViewById(2131100201));
    this.tv_user_con_psw_tishi = ((TextView)this.viewRegister.findViewById(2131100203));
    this.tv_user_nick_name_tishi = ((TextView)this.viewRegister.findViewById(2131100207));
    this.tv_xieyi = ((TextView)this.viewRegister.findViewById(2131100210));
    this.ck_xieyi = ((CheckBox)this.viewRegister.findViewById(2131100209));
    this.ck_xieyi.setChecked(false);
    this.tv_xieyi.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NewMainActivity.this.viewRegister.bringToFront();
        Intent localIntent = new Intent();
        localIntent.setClass(NewMainActivity.this.context, MainWebActivity.class);
        localIntent.putExtra("url", AppConstants.BASE_URL_IMG + "/wap/xy.html");
        localIntent.putExtra("title", "注册协议");
        NewMainActivity.this.startActivity(localIntent);
      }
    });
    this.tv_lianxi_kefu = ((TextView)this.viewRegister.findViewById(2131100211));
    this.tv_lianxi_kefu.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NewMainActivity.this.viewRegister.bringToFront();
        NewMainActivity.this.startActivity(new Intent(NewMainActivity.this, CustomServiceActivity.class));
      }
    });
    this.edit_register_username = ((EditText)this.viewRegister.findViewById(2131100200));
    this.edit_register_username.setOnFocusChangeListener(new View.OnFocusChangeListener()
    {
      public void onFocusChange(View paramAnonymousView, boolean paramAnonymousBoolean)
      {
        NewMainActivity.this.registerUserName = NewMainActivity.this.edit_register_username.getText().toString();
        if (!NewMainActivity.this.edit_register_username.hasFocus())
        {
          if ("".equals(NewMainActivity.this.registerUserName))
            NewMainActivity.this.tv_user_name_tishi.setText("请输入您的账号");
        }
        else
          return;
        if (!UiUtil.isValidUserName(NewMainActivity.this.registerUserName))
        {
          NewMainActivity.this.tv_user_name_tishi.setText("账号需要6~12位字符或数字");
          return;
        }
        NewMainActivity.this.tv_user_name_tishi.setText("");
      }
    });
    this.edit_register_psw = ((EditText)this.viewRegister.findViewById(2131100202));
    this.edit_register_psw.setOnFocusChangeListener(new View.OnFocusChangeListener()
    {
      public void onFocusChange(View paramAnonymousView, boolean paramAnonymousBoolean)
      {
        NewMainActivity.this.registerUserPsw = NewMainActivity.this.edit_register_psw.getText().toString();
        if (!NewMainActivity.this.edit_register_psw.hasFocus())
        {
          if ("".equals(NewMainActivity.this.registerUserPsw))
            NewMainActivity.this.tv_user_name_tishi.setText("请输入您的密码");
        }
        else
          return;
        if (!UiUtil.isValidUserName(NewMainActivity.this.registerUserPsw))
        {
          NewMainActivity.this.tv_user_name_tishi.setText("密码需要6~12位字符或数字");
          return;
        }
        if (NewMainActivity.this.registerUserName.equals(NewMainActivity.this.registerUserPsw))
        {
          NewMainActivity.this.tv_user_name_tishi.setText("账号和密码不能一致");
          return;
        }
        NewMainActivity.this.tv_user_name_tishi.setText("");
      }
    });
    this.edit_register_rppsw = ((EditText)this.viewRegister.findViewById(2131100204));
    this.edit_register_rppsw.setOnFocusChangeListener(new View.OnFocusChangeListener()
    {
      public void onFocusChange(View paramAnonymousView, boolean paramAnonymousBoolean)
      {
        NewMainActivity.this.registerUserPswRp = NewMainActivity.this.edit_register_rppsw.getText().toString();
        if (!NewMainActivity.this.edit_register_rppsw.hasFocus())
        {
          if (!NewMainActivity.this.registerUserPsw.equals(NewMainActivity.this.registerUserPswRp))
            NewMainActivity.this.tv_user_name_tishi.setText("两次密码不一致");
        }
        else
          return;
        NewMainActivity.this.tv_user_name_tishi.setText("");
      }
    });
    this.edit_register_introduce = ((EditText)this.viewRegister.findViewById(2131100206));
    this.edit_register_nickname = ((EditText)this.viewRegister.findViewById(2131100208));
    this.edit_register_nickname.setVisibility(8);
    this.edit_register_nickname.setOnFocusChangeListener(new View.OnFocusChangeListener()
    {
      public void onFocusChange(View paramAnonymousView, boolean paramAnonymousBoolean)
      {
        NewMainActivity.this.registerNickName = NewMainActivity.this.edit_register_nickname.getText().toString();
        LogUtils.e(NewMainActivity.this.TAG, "registerNickName：" + NewMainActivity.this.registerNickName);
        if (!NewMainActivity.this.edit_register_nickname.hasFocus())
        {
          if ("".equals(NewMainActivity.this.registerNickName))
            NewMainActivity.this.tv_user_nick_name_tishi.setText("请输入您的昵称");
        }
        else
          return;
        if (!UiUtil.isContainsChinese(NewMainActivity.this.registerNickName))
        {
          NewMainActivity.this.tv_user_nick_name_tishi.setText("昵称需要包含中文");
          return;
        }
        NewMainActivity.this.tv_user_nick_name_tishi.setText("");
      }
    });
    this.window_register.setSoftInputMode(16);
    this.img_register.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        AppConstants.NO_LOGIN_TOKEN = "";
        NewMainActivity.this.closeWindowSoftInput(NewMainActivity.this.getCurrentFocus());
        NewMainActivity.this.goRegister();
      }
    });
    this.window_register.setBackgroundDrawable(this.context.getResources().getDrawable(2130837534));
    this.window_register.setAnimationStyle(2131361795);
    this.window_register.showAtLocation(this.contentView, 17, 0, 60);
    this.window_register.setOnDismissListener(new PopupWindow.OnDismissListener()
    {
      public void onDismiss()
      {
        if (NewMainActivity.this.window_login.isShowing())
          NewMainActivity.this.window_login.dismiss();
        NewMainActivity.this.edit_register_username.setText("");
        NewMainActivity.this.edit_register_psw.setText("");
        NewMainActivity.this.edit_register_rppsw.setText("");
        NewMainActivity.this.edit_register_nickname.setText("");
        NewMainActivity.this.edit_register_introduce.setText("");
        NewMainActivity.this.tv_user_name_tishi.setText("");
        NewMainActivity.this.tv_user_psw_tishi.setText("");
        NewMainActivity.this.tv_user_con_psw_tishi.setText("");
        NewMainActivity.this.tv_user_nick_name_tishi.setText("");
      }
    });
  }

  private void showSelectWindow()
  {
    if (this.selectPopupWindow == null)
    {
      View localView = getLayoutInflater().inflate(2130903220, null);
      this.selectPopupWindow = new PopupWindow(localView, -1, -1);
      this.img_old_user = ((ImageView)localView.findViewById(2131100350));
      this.img_new_user = ((ImageView)localView.findViewById(2131100349));
      this.selectPopupWindow.setFocusable(true);
      this.selectPopupWindow.setOutsideTouchable(true);
      this.selectPopupWindow.setAnimationStyle(2131361794);
      this.img_old_user.setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          NewMainActivity.this.showOldUserPopwindow();
        }
      });
      this.img_new_user.setOnClickListener(new View.OnClickListener()
      {
        public void onClick(View paramAnonymousView)
        {
          NewMainActivity.this.img_new_user.setEnabled(false);
          NewMainActivity.this.newLogin(NewMainActivity.this.weixinMap);
        }
      });
    }
    this.selectPopupWindow.showAtLocation(findViewById(2131099699), 48, 0, 0);
  }

  private boolean startPing(String paramString)
  {
    Socket localSocket = new Socket();
    try
    {
      localSocket.connect(new InetSocketAddress(AppConstants.IP, Integer.valueOf(AppConstants.BASEPORT).intValue()), 5000);
      this.isUse = localSocket.isConnected();
      boolean bool = this.isUse;
      try
      {
        localSocket.close();
        return bool;
      }
      catch (IOException localIOException4)
      {
        localIOException4.printStackTrace();
        return bool;
      }
    }
    catch (IOException localIOException2)
    {
      localIOException2 = localIOException2;
      localIOException2.printStackTrace();
      this.isUse = false;
      try
      {
        localSocket.close();
        return false;
      }
      catch (IOException localIOException3)
      {
        localIOException3.printStackTrace();
        return false;
      }
    }
    finally
    {
    }
    try
    {
      localSocket.close();
      throw localObject;
    }
    catch (IOException localIOException1)
    {
      while (true)
        localIOException1.printStackTrace();
    }
  }

  private void weixinBut()
  {
    this.isWxDefaultLogin = false;
    showLoadingDialog();
    Platform localPlatform = ShareSDK.getPlatform(Wechat.NAME);
    if (localPlatform.isValid())
      localPlatform.removeAccount();
    if (!Tool.canGetUserInfo(localPlatform));
    while ((localPlatform instanceof CustomPlatform))
      return;
    login(Wechat.NAME);
  }

  private void wxLogin(final Map<String, Object> paramMap)
  {
    HashMap localHashMap = new HashMap();
    localHashMap.put("nickname", paramMap.get("nickname"));
    localHashMap.put("open_id", paramMap.get("openid"));
    localHashMap.put("headimgurl", paramMap.get("headimgurl"));
    localHashMap.put("client_type", "1");
    localHashMap.put("client_Id", CustomApplication.app.IMEI);
    RequestNet.get(this.context, AppConstants.WX_LOGIN, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        Log.e(NewMainActivity.this.TAG, "登陆失败,login-result:" + paramAnonymousException);
        NewMainActivity.this.dismissLoadingDialog();
        NewMainActivity.this.setWxBtnIsEnable(true);
      }

      public void onResponse(String paramAnonymousString)
      {
        NewMainActivity.this.dismissLoadingDialog();
        NewMainActivity.this.wx_login_view.setEnabled(true);
        if (paramAnonymousString.isEmpty());
        UserBean localUserBean;
        do
        {
          return;
          Gson localGson = new Gson();
          try
          {
            localUserBean = (UserBean)localGson.fromJson(paramAnonymousString, UserBean.class);
            if (localUserBean == null)
            {
              UiUtil.showToast(NewMainActivity.this.context, "登陆失败");
              return;
            }
          }
          catch (Exception localException)
          {
            while (true)
            {
              localException.printStackTrace();
              localUserBean = null;
            }
            if (localUserBean.getFlag() == -4)
            {
              NewMainActivity.activityStack.backToMain(NewMainActivity.class, NewMainActivity.this);
              return;
            }
            LogUtils.e(NewMainActivity.this.TAG, "s:  " + paramAnonymousString);
            CustomApplication.app.userBaseBean = localUserBean.getResult();
            if ((localUserBean.getFlag() != 1) && (localUserBean.getFlag() != 0))
            {
              NewMainActivity.this.ShowDialog1(localUserBean.getMsg());
              return;
            }
            if ((localUserBean.getFlag() == 0) && (!NewMainActivity.this.isWxDefaultLogin))
              NewMainActivity.this.showSelectWindow();
          }
        }
        while ((localUserBean.getFlag() != 1) || (CustomApplication.app.userBaseBean == null));
        LogUtils.i(NewMainActivity.this.TAG, "登陆成功");
        CustomApplication.app.isLogin = true;
        String str1 = CustomApplication.app.userBaseBean.getGuid();
        String str2 = CustomApplication.app.userBaseBean.getAccessToken();
        LogUtils.d(NewMainActivity.this.TAG, "guid：" + str1);
        LogUtils.d(NewMainActivity.this.TAG, "accessToken：" + str2);
        LogUtils.d(NewMainActivity.this.TAG, "memberId：" + CustomApplication.app.userBaseBean.getMemberid());
        LogUtils.d(NewMainActivity.this.TAG, "SessionToken：" + CustomApplication.app.userBaseBean.getSessionToken());
        LogUtils.d(NewMainActivity.this.TAG, "IsRoomOwner：" + CustomApplication.app.userBaseBean.IsRoomOwner);
        LogUtils.d(NewMainActivity.this.TAG, "nick_name：" + CustomApplication.app.userBaseBean.nick_name);
        if (NewMainActivity.this.window_login != null)
          NewMainActivity.this.window_login.dismiss();
        CustomApplication.app.preferencesUtil.setValue(AppConstants.LOGIN_TOKEN, str2);
        CustomApplication.app.preferencesUtil.setValue(AppConstants.WX_NAME, paramMap.get("nickname"));
        CustomApplication.app.preferencesUtil.setValue(AppConstants.WX_OPID, paramMap.get("openid"));
        CustomApplication.app.preferencesUtil.setValue(AppConstants.WX_HEAD_IMG, paramMap.get("headimgurl"));
        CustomApplication.app.preferencesUtil.setValue(AppConstants.LOGIN_TYPE, "2");
        CustomApplication.app.preferencesUtil.setValue(AppConstants.LOGIN_USERNAME, CustomApplication.app.userBaseBean.getUser_name());
        NewMainActivity.this.initUserData();
        NewMainActivity.this.getUserAmount(NewMainActivity.this.tv_user_amount);
      }
    });
  }

  public void Isboundphone()
  {
    HashMap localHashMap = new HashMap();
    localHashMap.put("memberid", CustomApplication.app.userBaseBean.getMemberid());
    LogUtils.d(this.TAG, "URL:" + AppConstants.URL_GET_TELEPHONESTATE);
    RequestNet.get(this.context, AppConstants.URL_GET_TELEPHONESTATE, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        LogUtils.e(NewMainActivity.this.TAG, "获取失败,是否绑定手机:" + paramAnonymousException);
      }

      public void onResponse(String paramAnonymousString)
      {
        LogUtils.d(NewMainActivity.this.TAG, "是否绑定手机" + paramAnonymousString);
        if (UiUtil.IsValueEmpty(paramAnonymousString))
          LogUtils.d(NewMainActivity.this.TAG, "为空时result:" + paramAnonymousString);
        IsBoundPhoneBean localIsBoundPhoneBean;
        do
        {
          return;
          Gson localGson = new Gson();
          try
          {
            localIsBoundPhoneBean = (IsBoundPhoneBean)localGson.fromJson(paramAnonymousString, IsBoundPhoneBean.class);
            if (localIsBoundPhoneBean == null)
            {
              LogUtils.e(NewMainActivity.this.TAG, "isBoundPhoneBean，获取失败");
              return;
            }
          }
          catch (Exception localException)
          {
            while (true)
            {
              localException.printStackTrace();
              localIsBoundPhoneBean = null;
            }
            if (localIsBoundPhoneBean.getFlag() == -4)
            {
              NewMainActivity.activityStack.backToMain(NewMainActivity.class, NewMainActivity.this);
              return;
            }
            if (localIsBoundPhoneBean.getFlag() == -2)
            {
              if (NewMainActivity.this.popWindowLeft != null)
                NewMainActivity.this.popWindowLeft.dismiss();
              NewMainActivity.this.showDownWireDialog();
              return;
            }
            if (localIsBoundPhoneBean.getFlag() == -3)
            {
              NewMainActivity.this.ShowFengjinDialog();
              return;
            }
            if (localIsBoundPhoneBean.getFlag() == 0)
            {
              NewMainActivity.this.myDialog1.setMessage(localIsBoundPhoneBean.getMsg());
              NewMainActivity.this.myDialog1.show();
              NewMainActivity.this.myDialog1.btn_confirm.setOnClickListener(new View.OnClickListener()
              {
                public void onClick(View paramAnonymous2View)
                {
                  NewMainActivity.this.myDialog1.dismiss();
                }
              });
              return;
            }
          }
        }
        while (localIsBoundPhoneBean.getFlag() != 1);
        if (localIsBoundPhoneBean.getState() == 0)
        {
          NewMainActivity.this.Issetpaypassword();
          return;
        }
        NewMainActivity.this.myDialog1.setMessage("为了您的资金安全，请绑定手机号");
        NewMainActivity.this.myDialog1.show();
        NewMainActivity.this.myDialog1.btn_confirm.setOnClickListener(new View.OnClickListener()
        {
          public void onClick(View paramAnonymous2View)
          {
            NewMainActivity.this.startActivity(new Intent(NewMainActivity.this, BoundPhoneActivity.class));
            NewMainActivity.this.myDialog1.dismiss();
          }
        });
      }
    });
  }

  public void Issetbankcard()
  {
    HashMap localHashMap = new HashMap();
    localHashMap.put("memberid", CustomApplication.app.userBaseBean.getMemberid());
    LogUtils.d(this.TAG, "URL:" + AppConstants.URL_GET_ISSETBANKCARD);
    showLoadingDialog();
    RequestNet.get(this.context, AppConstants.URL_GET_ISSETBANKCARD, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        NewMainActivity.this.dismissLoadingDialog();
        LogUtils.e(NewMainActivity.this.TAG, "获取失败,获取提现记录:" + paramAnonymousException);
      }

      public void onResponse(String paramAnonymousString)
      {
        NewMainActivity.this.dismissLoadingDialog();
        if (UiUtil.IsValueEmpty(paramAnonymousString))
        {
          LogUtils.d(NewMainActivity.this.TAG, "为空时result:" + paramAnonymousString);
          return;
        }
        Gson localGson = new Gson();
        try
        {
          localIsSetBankCardModel = (IsSetBankCardModel)localGson.fromJson(paramAnonymousString, IsSetBankCardModel.class);
          if (localIsSetBankCardModel == null)
          {
            LogUtils.e(NewMainActivity.this.TAG, "isSetBankCardModel，获取失败");
            return;
          }
        }
        catch (Exception localException)
        {
          IsSetBankCardModel localIsSetBankCardModel;
          while (true)
          {
            localException.printStackTrace();
            localIsSetBankCardModel = null;
          }
          if (localIsSetBankCardModel.getFlag() == -4)
          {
            NewMainActivity.activityStack.backToMain(NewMainActivity.class, NewMainActivity.this);
            return;
          }
          if (localIsSetBankCardModel.getFlag() == -2)
          {
            if (NewMainActivity.this.popWindowLeft != null)
              NewMainActivity.this.popWindowLeft.dismiss();
            NewMainActivity.this.showDownWireDialog();
            return;
          }
          if (localIsSetBankCardModel.getFlag() == -3)
          {
            NewMainActivity.this.ShowFengjinDialog();
            return;
          }
          if (localIsSetBankCardModel.getFlag() == 0)
          {
            NewMainActivity.this.myDialog1.setMessage("请先绑定您的银行卡");
            NewMainActivity.this.myDialog1.show();
            NewMainActivity.this.myDialog1.btn_confirm.setBackgroundResource(2130837708);
            NewMainActivity.this.myDialog1.btn_confirm.setOnClickListener(new View.OnClickListener()
            {
              public void onClick(View paramAnonymous2View)
              {
                NewMainActivity.this.startActivity(new Intent(NewMainActivity.this, BoundBankCardActivity.class));
                NewMainActivity.this.myDialog1.dismiss();
              }
            });
            return;
          }
          IsSetBankCardBean localIsSetBankCardBean = localIsSetBankCardModel.getBankinfo();
          if (localIsSetBankCardBean == null)
          {
            LogUtils.e(NewMainActivity.this.TAG, "isSetBankCardModel-result=null");
            return;
          }
          String str1 = localIsSetBankCardBean.getAccountholder();
          String str2 = localIsSetBankCardBean.getBankcardid();
          String str3 = localIsSetBankCardBean.getBankname();
          Intent localIntent = new Intent();
          localIntent.putExtra("accountholder", str1);
          localIntent.putExtra("bankcardid", str2);
          localIntent.putExtra("bankname", str3);
          localIntent.putExtra("paypass", NewMainActivity.this.paypass);
          localIntent.setClass(NewMainActivity.this, TiXianActivity.class);
          NewMainActivity.this.startActivity(localIntent);
        }
      }
    });
  }

  public void Issetpaypassword()
  {
    HashMap localHashMap = new HashMap();
    localHashMap.put("memberid", CustomApplication.app.userBaseBean.getMemberid());
    LogUtils.d(this.TAG, "URL:" + AppConstants.URL_GET_ISSETPAYPASSWORD);
    RequestNet.get(this.context, AppConstants.URL_GET_ISSETPAYPASSWORD, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        LogUtils.e(NewMainActivity.this.TAG, "获取失败,获取提现记录:" + paramAnonymousException);
      }

      public void onResponse(String paramAnonymousString)
      {
        if (UiUtil.IsValueEmpty(paramAnonymousString))
          LogUtils.d(NewMainActivity.this.TAG, "为空时result:" + paramAnonymousString);
        IsSetPayPasswordBean localIsSetPayPasswordBean;
        do
        {
          return;
          Gson localGson = new Gson();
          try
          {
            localIsSetPayPasswordBean = (IsSetPayPasswordBean)localGson.fromJson(paramAnonymousString, IsSetPayPasswordBean.class);
            if (localIsSetPayPasswordBean == null)
            {
              LogUtils.e(NewMainActivity.this.TAG, "IsSetPayPasswordBean，获取失败");
              return;
            }
          }
          catch (Exception localException)
          {
            while (true)
            {
              localException.printStackTrace();
              localIsSetPayPasswordBean = null;
            }
            if (localIsSetPayPasswordBean.getFlag() == -4)
            {
              NewMainActivity.activityStack.backToMain(NewMainActivity.class, NewMainActivity.this);
              return;
            }
            if (localIsSetPayPasswordBean.getFlag() == -2)
            {
              if (NewMainActivity.this.popWindowLeft != null)
                NewMainActivity.this.popWindowLeft.dismiss();
              NewMainActivity.this.showDownWireDialog();
              return;
            }
            if (localIsSetPayPasswordBean.getFlag() == -3)
            {
              NewMainActivity.this.ShowFengjinDialog();
              return;
            }
            if (localIsSetPayPasswordBean.getFlag() == 0)
            {
              NewMainActivity.this.myDialog1.setMessage("请先设置您的提现密码");
              NewMainActivity.this.myDialog1.show();
              NewMainActivity.this.myDialog1.btn_confirm.setOnClickListener(new View.OnClickListener()
              {
                public void onClick(View paramAnonymous2View)
                {
                  NewMainActivity.this.startActivity(new Intent(NewMainActivity.this, SafeCodeActivity.class));
                  NewMainActivity.this.myDialog1.dismiss();
                }
              });
              return;
            }
          }
        }
        while (localIsSetPayPasswordBean.getFlag() != 1);
        NewMainActivity.this.paypass = localIsSetPayPasswordBean.getPaypass();
        NewMainActivity.this.Issetbankcard();
      }
    });
  }

  public void autoLogin()
  {
    if (CustomApplication.app.isLogin)
      return;
    String str1 = CustomApplication.app.preferencesUtil.getValue(AppConstants.LOGIN_USERNAME, "");
    String str2 = CustomApplication.app.preferencesUtil.getValue(AppConstants.LOGIN_PWD, "");
    if ((str1 == null) || ("".equals(str1)))
    {
      LogUtils.e(this.TAG, "userName should be valued!");
      return;
    }
    if ((str2 == null) || ("".equals(str2)))
    {
      LogUtils.e(this.TAG, "userPsw should be valued!");
      return;
    }
    HashMap localHashMap = new HashMap();
    localHashMap.put("user_name", str1);
    localHashMap.put("password", str2);
    localHashMap.put("client_type", "1");
    localHashMap.put("client_Id", CustomApplication.app.IMEI);
    localHashMap.put("Client_Ip", CustomApplication.app.NetIP);
    LogUtils.d(this.TAG, "userName:" + str1);
    LogUtils.d(this.TAG, "userPsw:" + str2);
    RequestNet.post(this.context, AppConstants.URL_LOGIN, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        LogUtils.e(NewMainActivity.this.TAG, "获取失败,login-result:" + paramAnonymousException);
      }

      public void onResponse(String paramAnonymousString)
      {
        LogUtils.i(NewMainActivity.this.TAG, paramAnonymousString);
        if (paramAnonymousString.isEmpty());
        do
        {
          UserBean localUserBean;
          do
          {
            return;
            Gson localGson = new Gson();
            try
            {
              localUserBean = (UserBean)localGson.fromJson(paramAnonymousString, UserBean.class);
              if (localUserBean == null)
              {
                LogUtils.d(NewMainActivity.this.TAG, "自动登陆失败");
                return;
              }
            }
            catch (Exception localException)
            {
              while (true)
              {
                localException.printStackTrace();
                localUserBean = null;
              }
            }
          }
          while (localUserBean == null);
          if (localUserBean.getFlag() == -4)
          {
            NewMainActivity.activityStack.backToMain(NewMainActivity.class, NewMainActivity.this);
            return;
          }
          CustomApplication.app.userBaseBean = localUserBean.getResult();
          if (localUserBean.getFlag() != 1)
          {
            CustomApplication.app.isLogin = false;
            UiUtil.showToast(NewMainActivity.this.getApplicationContext(), localUserBean.getMsg());
            return;
          }
        }
        while (CustomApplication.app.userBaseBean == null);
        LogUtils.d(NewMainActivity.this.TAG, "自动登陆成功");
        CustomApplication.app.isLogin = true;
        if ((NewMainActivity.this.dongtaiFragment != null) && (CustomApplication.app.isLogin))
          NewMainActivity.this.dongtaiFragment.getDataFromServer();
        CustomApplication.app.preferencesUtil.setValue(AppConstants.LOGIN_TOKEN, CustomApplication.app.userBaseBean.getAccessToken());
        NewMainActivity.this.initUserData();
        NewMainActivity.this.getUserAmount(NewMainActivity.this.tv_user_amount);
      }
    });
  }

  public boolean checkApplication(String paramString)
  {
    if ((paramString == null) || ("".equals(paramString)))
      return false;
    try
    {
      getPackageManager().getApplicationInfo(paramString, 8192);
      return true;
    }
    catch (PackageManager.NameNotFoundException localNameNotFoundException)
    {
    }
    return false;
  }

  public void deleteolddate()
  {
    SharedPreferences.Editor localEditor1 = this.context.getSharedPreferences("date", 0).edit();
    localEditor1.putString("gonggao", "");
    localEditor1.commit();
    SharedPreferences.Editor localEditor2 = this.context.getSharedPreferences("dicos", 0).edit();
    localEditor2.putString("weidugonggao", "");
    localEditor2.commit();
  }

  public boolean dispatchKeyEvent(KeyEvent paramKeyEvent)
  {
    if ((paramKeyEvent.getKeyCode() == 4) && (paramKeyEvent.getAction() == 0) && (paramKeyEvent.getRepeatCount() == 0))
    {
      if (selectIndex != 0)
      {
        performClickBtn(0);
        return true;
      }
      if (System.currentTimeMillis() - this.mExitTime > 2000L)
      {
        UiUtil.showToast(this.context, "再按一次退出");
        this.mExitTime = System.currentTimeMillis();
        return true;
      }
      CustomApplication.app.finishAllActivity();
      finish();
      Process.killProcess(Process.myPid());
      System.exit(0);
      return true;
    }
    return super.dispatchKeyEvent(paramKeyEvent);
  }

  public void getHasNoRead(final ImageView paramImageView)
  {
    if (!CustomApplication.app.isLogin)
      return;
    HashMap localHashMap = new HashMap();
    localHashMap.put("memberid", CustomApplication.app.userBaseBean.getMemberid());
    localHashMap.put("isread", "0");
    localHashMap.put("page", "1");
    localHashMap.put("pagesize", "10");
    localHashMap.put("type", "2");
    LogUtils.d(this.TAG, "URL:" + AppConstants.URL_USER_GETMESSAGELIST);
    RequestNet.get(this.context, AppConstants.URL_USER_GETMESSAGELIST, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        LogUtils.e(NewMainActivity.this.TAG, "获取失败,getMessageTitle-result:" + paramAnonymousException);
      }

      public void onResponse(String paramAnonymousString)
      {
        if ((paramAnonymousString == null) || ("".equals(paramAnonymousString)))
          LogUtils.e(NewMainActivity.this.TAG, "result:" + paramAnonymousString);
        MessageTitleBean localMessageTitleBean;
        do
        {
          return;
          LogUtils.i(NewMainActivity.this.TAG, "服务器返回未读消息=" + paramAnonymousString);
          Gson localGson = new Gson();
          try
          {
            localMessageTitleBean = (MessageTitleBean)localGson.fromJson(paramAnonymousString, MessageTitleBean.class);
            if (localMessageTitleBean == null)
            {
              LogUtils.e(NewMainActivity.this.TAG, "getMessageTitle == null，获取失败");
              return;
            }
          }
          catch (Exception localException)
          {
            while (true)
            {
              localException.printStackTrace();
              localMessageTitleBean = null;
            }
            if (localMessageTitleBean.flag == -4)
            {
              NewMainActivity.activityStack.backToMain(NewMainActivity.class, NewMainActivity.this);
              return;
            }
            System.out.println("获取flag=" + localMessageTitleBean.flag);
            if (localMessageTitleBean.flag == -2)
            {
              if (NewMainActivity.this.popWindowLeft != null)
                NewMainActivity.this.popWindowLeft.dismiss();
              LogUtils.e(NewMainActivity.this.TAG, " 判断popup是否有未读消息");
              return;
            }
            if (localMessageTitleBean.flag == -3)
            {
              NewMainActivity.this.ShowFengjinDialog();
              return;
            }
          }
        }
        while (localMessageTitleBean.flag != 1);
        String str = NewMainActivity.this.context.getSharedPreferences("date", 0).getString("gonggao", "");
        LogUtils.e(NewMainActivity.this.TAG, "old:" + str);
        int i = NewMainActivity.this.context.getSharedPreferences("dicos", 0).getString("weidugonggao", "").length();
        if ((localMessageTitleBean.total > 0) || ("".equals(str)) || (str.length() < i))
          LogUtils.e(NewMainActivity.this.TAG, "有公告未读消息=" + localMessageTitleBean.total);
        while (localMessageTitleBean.total > 0)
        {
          paramImageView.setVisibility(0);
          LogUtils.e(NewMainActivity.this.TAG, "有个人未读消息=" + localMessageTitleBean.total);
          return;
          if ((localMessageTitleBean.total == 0) && (!"".equals(str)))
          {
            LogUtils.e(NewMainActivity.this.TAG, "没有公告未读消息=" + localMessageTitleBean.total);
            NewMainActivity.this.home_rb_nav02.setBackgroundResource(2130838192);
          }
        }
        paramImageView.setVisibility(8);
        LogUtils.e(NewMainActivity.this.TAG, "没有个人未读消息=" + localMessageTitleBean.total);
      }
    });
  }

  public void httpupdate()
  {
    HashMap localHashMap = new HashMap();
    RequestNet.get(this.context, AppConstants.URL_GET_GETAPPVERISON, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        LogUtils.e(NewMainActivity.this.TAG, "获取失败,获取服务器版本号:" + paramAnonymousException);
      }

      public void onResponse(String paramAnonymousString)
      {
        LogUtils.e("---", "~~~~~~~~~~~~" + paramAnonymousString);
        Gson localGson = new Gson();
        try
        {
          localUpdateBean = (UpdateBean)localGson.fromJson(paramAnonymousString, UpdateBean.class);
          if (localUpdateBean == null)
            return;
        }
        catch (Exception localException)
        {
          while (true)
          {
            localException.printStackTrace();
            UpdateBean localUpdateBean = null;
            continue;
            if (localUpdateBean.getFlag().equals("-4"))
            {
              NewMainActivity.activityStack.backToMain(NewMainActivity.class, NewMainActivity.this);
              return;
            }
            String str = localUpdateBean.getAndroid_version();
            NewMainActivity.this.apk_url = localUpdateBean.getAndroid_url();
            try
            {
              if ((!TextUtils.isEmpty(str)) && (str.matches("^\\d+(\\.\\d+)?$")))
              {
                float f = Float.parseFloat(str);
                NewMainActivity.this.doCheckUpdateDone(Float.valueOf(f));
                return;
              }
            }
            catch (NumberFormatException localNumberFormatException)
            {
              localNumberFormatException.printStackTrace();
            }
          }
        }
      }
    });
  }

  public void init()
  {
    mainActivity = this;
    this.screenWidth = CustomApplication.app.displayMetrics.widthPixels;
    this.containerIds = new int[] { 2131099889, 2131099890, 2131099891, 2131099892, 2131099893 };
    this.containers = new FrameLayout[this.containerIds.length];
    int i = 0;
    int j;
    label225: int k;
    if (i >= this.containerIds.length)
    {
      this.bottomLinIds = new int[] { 2131099895, 2131099898, 2131099901, 2131099906, 2131099909 };
      this.bottomBtnIds = new int[] { 2131099896, 2131099899, 2131099902, 2131099907, 2131099910 };
      this.bottomTvIds = new int[] { 2131099897, 2131099900, 2131099903, 2131099908, 2131099911 };
      mLinList = new LinearLayout[this.bottomLinIds.length];
      this.mBtnList = new Button[this.bottomBtnIds.length];
      this.mTvList = new TextView[this.bottomTvIds.length];
      j = 0;
      if (j < this.bottomLinIds.length)
        break label602;
      k = 0;
      label236: if (k < this.bottomBtnIds.length)
        break label635;
    }
    for (int m = 0; ; m++)
    {
      if (m >= this.bottomTvIds.length)
      {
        performClickBtn(0);
        this.myDialog1 = new MyDialog1(this.context);
        this.viewLeft = LayoutInflater.from(this.context).inflate(2130903196, null);
        this.tv_user_amount = ((TextView)this.viewLeft.findViewById(2131100303));
        this.iv_msg_number = ((ImageView)this.viewLeft.findViewById(2131100306));
        this.viewRight = LayoutInflater.from(this).inflate(2130903177, null);
        this.viewLogin = LayoutInflater.from(this.context).inflate(2130903162, null);
        this.olduserpop = LayoutInflater.from(this.context).inflate(2130903164, null);
        this.tv_go_register = ((TextView)this.viewLogin.findViewById(2131100193));
        this.tv_go_register.setOnClickListener(new View.OnClickListener()
        {
          public void onClick(View paramAnonymousView)
          {
            NewMainActivity.this.showRegisterPopwindow();
          }
        });
        this.tv_forget_pwd = ((TextView)this.viewLogin.findViewById(2131100194));
        this.tv_forget_pwd.setOnClickListener(new View.OnClickListener()
        {
          public void onClick(View paramAnonymousView)
          {
            NewMainActivity.this.startActivity(new Intent(NewMainActivity.this, ForgetLoginPwdActivity.class));
          }
        });
        this.img_login = ((ImageView)this.viewLogin.findViewById(2131100195));
        this.wx_login_view = ((ImageView)this.viewLogin.findViewById(2131100196));
        this.qq_login_view = ((ImageView)this.viewLogin.findViewById(2131100197));
        this.edit_login_username = ((EditText)this.viewLogin.findViewById(2131100191));
        this.edit_login_username.addTextChangedListener(this.textWatcher);
        this.edit_login_psw = ((EditText)this.viewLogin.findViewById(2131100192));
        this.viewRegister = LayoutInflater.from(this.context).inflate(2130903165, null);
        this.img_register = ((ImageView)this.viewRegister.findViewById(2131100212));
        return;
        this.containers[i] = ((FrameLayout)findViewById(this.containerIds[i]));
        i++;
        break;
        label602: mLinList[j] = ((LinearLayout)findViewById(this.bottomLinIds[j]));
        mLinList[j].setOnClickListener(this);
        j++;
        break label225;
        label635: this.mBtnList[k] = ((Button)findViewById(this.bottomBtnIds[k]));
        this.mBtnList[k].setClickable(false);
        k++;
        break label236;
      }
      this.mTvList[m] = ((TextView)findViewById(this.bottomTvIds[m]));
      this.mTvList[m].setClickable(false);
    }
  }

  public void isFirst()
  {
    SharedPreferences localSharedPreferences = getSharedPreferences("share19", 0);
    boolean bool = localSharedPreferences.getBoolean("isFirstRun", true);
    SharedPreferences.Editor localEditor = localSharedPreferences.edit();
    if (bool)
    {
      LogUtils.d(this.TAG, "第一次运行");
      localEditor.putBoolean("isFirstRun", false);
      localEditor.commit();
      showtishi();
      deleteolddate();
      return;
    }
    LogUtils.d(this.TAG, "不是第一次运行");
  }

  public void navigateToNoAnimWithId(Fragment paramFragment, int paramInt)
  {
    FragmentTransaction localFragmentTransaction = getSupportFragmentManager().beginTransaction();
    localFragmentTransaction.replace(paramInt, paramFragment);
    localFragmentTransaction.addToBackStack(paramFragment.getClass().getSimpleName());
    localFragmentTransaction.commit();
  }

  protected void onActivityResult(int paramInt1, int paramInt2, Intent paramIntent)
  {
    if (paramInt2 == -1);
    switch (paramInt1)
    {
    default:
    case 1:
    case 2:
      do
      {
        Uri localUri;
        do
        {
          return;
          localUri = Uri.fromFile(new File(this.camera_fileName));
          LogUtils.d(this.TAG, "uri:" + localUri);
        }
        while (localUri == null);
        startPhotoZoom(localUri);
        return;
      }
      while (paramIntent == null);
      startPhotoZoom(Uri.fromFile(new File(AppFinal.getPath(this, paramIntent.getData()))));
      return;
    case 3:
    }
    try
    {
      this.uritempFile = Uri.parse("file:///" + AppFinal.CACHE_DIR_UPLOADING_IMG + "/" + this.imgName);
      LogUtils.d(this.TAG, "uritempFile:" + this.uritempFile);
      sendUserPhoto(BitmapFactory.decodeStream(getContentResolver().openInputStream(this.uritempFile)));
      return;
    }
    catch (FileNotFoundException localFileNotFoundException)
    {
      localFileNotFoundException.printStackTrace();
    }
  }

  public void onClick(View paramView)
  {
    switch (paramView.getId())
    {
    default:
    case 2131099895:
    case 2131099898:
    case 2131099901:
    case 2131099906:
    case 2131099909:
    }
    while (true)
    {
      setButtonColor(selectIndex);
      return;
      if (CustomApplication.app.isLogin)
        getTopMessage();
      selectIndex = 0;
      getHasNoRead(this.iv_msg_number);
      if (this.indexFragment == null)
      {
        this.indexFragment = new NewIndexFragment();
        navigateToNoAnimWithId(this.indexFragment, 2131099889);
      }
      setTitle(8, 8, 2130838158, "PC蛋蛋", 0, 8, 8, 2130837626, true);
      continue;
      getHasNoRead(this.iv_msg_number);
      selectIndex = 1;
      if (this.chongZhiFragment == null)
      {
        this.chongZhiFragment = new NewZhaopinFragment();
        navigateToNoAnimWithId(this.chongZhiFragment, 2131099890);
      }
      setTitle(8, 8, 0, "招聘", 0, 8, 8, 0, true);
      continue;
      getHasNoRead(this.iv_msg_number);
      selectIndex = 2;
      if (this.dongtaiFragment == null)
      {
        this.dongtaiFragment = new NewDongTaiFragment();
        navigateToNoAnimWithId(this.dongtaiFragment, 2131099891);
      }
      setTitle(8, 8, 0, "动态", 0, 8, 8, 0, true);
      continue;
      getHasNoRead(this.iv_msg_number);
      selectIndex = 3;
      if (this.mineFragment == null)
      {
        this.mineFragment = new NewuiMineFragment();
        navigateToNoAnimWithId(this.mineFragment, 2131099892);
      }
      setTitle(8, 8, 0, "我的", 0, 8, 8, 0, false);
      continue;
      selectIndex = 4;
    }
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    this.context = this;
    this.contentView = LayoutInflater.from(this.context).inflate(2130903206, null);
    setContentView(this.contentView);
    init();
    initOtherLogin();
    this.home_rb_nav02 = ((Button)this.contentView.findViewById(2131099902));
    isFirst();
    if (AppConstants.NO_LOGIN_TOKEN.equals(""))
      getToken();
    while (true)
    {
      Log.d(this.TAG, "isBundleSaved:" + this.isBundleSaved);
      registerNetReceiver();
      return;
      chekcLogin();
    }
  }

  protected void onDestroy()
  {
    super.onDestroy();
    if ((this.mModifyDialog != null) && (this.mModifyDialog.isShowing()))
    {
      this.mModifyDialog.dismiss();
      this.mModifyDialog = null;
    }
    if (this.receiverNet != null)
    {
      unregisterReceiver(this.receiverNet);
      return;
    }
    LogUtils.e(this.TAG, "onDestroy(),网络监听注销失败");
  }

  public void onRestoreInstanceState(Bundle paramBundle)
  {
    if (paramBundle.containsKey("save_camera_fileName"))
      this.camera_fileName = paramBundle.getString("save_camera_fileName");
    if (paramBundle.containsKey("imgName"))
      this.imgName = paramBundle.getString("imgName");
    if (paramBundle.containsKey("isBundleSaved"))
      this.isBundleSaved = Boolean.valueOf(true);
    LogUtils.d(this.TAG, "屏幕旋转啦！isBundleSaved：" + this.isBundleSaved);
    super.onRestoreInstanceState(paramBundle);
  }

  protected void onResume()
  {
    super.onResume();
    httpupdate();
    if (CustomApplication.app.isLogin)
    {
      initUserData();
      getUserAmount(this.tv_user_amount);
      getHasNoRead(this.iv_msg_number);
      getTopMessage();
    }
    while (true)
    {
      Uninstall("com.hsc.pcdd");
      return;
      LogUtils.e(this.TAG, "未登录");
    }
  }

  public void onSaveInstanceState(Bundle paramBundle)
  {
    paramBundle.putString("save_camera_fileName", this.camera_fileName);
    paramBundle.putString("imgName", this.imgName);
    paramBundle.putBoolean("isBundleSaved", this.isBundleSaved.booleanValue());
    super.onSaveInstanceState(paramBundle);
  }

  public void performClickBtn(int paramInt)
  {
    mLinList[paramInt].performClick();
  }

  public void selectPic()
  {
    Intent localIntent = new Intent("android.intent.action.GET_CONTENT");
    localIntent.setType(AppFinal.IMAGE_UNSPECIFIED);
    startActivityForResult(Intent.createChooser(localIntent, "选择图片"), 2);
  }

  @SuppressLint({"NewApi"})
  public void setTitle(int paramInt1, int paramInt2, int paramInt3, String paramString, int paramInt4, int paramInt5, int paramInt6, int paramInt7, boolean paramBoolean)
  {
    View localView = findViewById(2131099716);
    if (paramBoolean)
      localView.setVisibility(0);
    while (true)
    {
      TextView localTextView1 = (TextView)localView.findViewById(2131099701);
      localTextView1.setBackgroundResource(paramInt4);
      localTextView1.setText(paramString);
      ((TextView)localView.findViewById(2131099700)).setVisibility(paramInt1);
      ImageView localImageView = (ImageView)localView.findViewById(2131099699);
      localImageView.setVisibility(paramInt2);
      localImageView.setOnClickListener(this.onClickListener);
      localImageView.setImageResource(paramInt3);
      TextView localTextView2 = (TextView)localView.findViewById(2131099702);
      localTextView2.setVisibility(paramInt5);
      localTextView2.setOnClickListener(this.onClickListener);
      this.iv_title_right = ((ImageView)localView.findViewById(2131099704));
      this.iv_title_right.setVisibility(paramInt6);
      this.iv_title_right.setOnClickListener(this.onClickListener);
      this.iv_title_right.setImageResource(paramInt7);
      return;
      localView.setVisibility(8);
    }
  }

  public void showFengjinDialog()
  {
    ShowFengjinDialog();
  }

  public void showLoginPop()
  {
    CustomApplication.app.isLogin = false;
    showLoginPopwindow();
  }

  public void showOffLineDialog()
  {
    showDownWireDialog();
  }

  public void showPickPhotoPopupWindow()
  {
    View localView = LayoutInflater.from(this).inflate(2130903161, null);
    TextView localTextView1 = (TextView)localView.findViewById(2131100188);
    TextView localTextView2 = (TextView)localView.findViewById(2131100187);
    TextView localTextView3 = (TextView)localView.findViewById(2131100189);
    final CustomDialog localCustomDialog = new CustomDialog(this, 2131361804).create(localView, true, 1.0F, 0.4F, 1.0F);
    localCustomDialog.show();
    localTextView3.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        localCustomDialog.dismiss();
      }
    });
    localTextView1.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NewMainActivity.this.takePhoto();
        localCustomDialog.dismiss();
      }
    });
    localTextView2.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NewMainActivity.this.selectPic();
        localCustomDialog.dismiss();
      }
    });
    localTextView3.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        localCustomDialog.dismiss();
      }
    });
    localCustomDialog.setOnDismissListener(new DialogInterface.OnDismissListener()
    {
      public void onDismiss(DialogInterface paramAnonymousDialogInterface)
      {
      }
    });
  }

  @SuppressLint({"NewApi"})
  public void showPopupWindowMenu()
  {
    (6 * (CustomApplication.app.displayMetrics.widthPixels / 10));
    this.popupWindowRight = new PopupWindow(this.viewRight, -2, -2, true);
    TextView localTextView1 = (TextView)this.viewRight.findViewById(2131100169);
    TextView localTextView2 = (TextView)this.viewRight.findViewById(2131100170);
    TextView localTextView3 = (TextView)this.viewRight.findViewById(2131100171);
    TextView localTextView4 = (TextView)this.viewRight.findViewById(2131100174);
    localTextView1.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NewMainActivity.this.startActivity(new Intent(NewMainActivity.this, JiLuActivity.class));
        NewMainActivity.this.popupWindowRight.dismiss();
      }
    });
    localTextView2.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NewMainActivity.this.startActivity(new Intent(NewMainActivity.this, ChongzhiActivity.class));
        NewMainActivity.this.popupWindowRight.dismiss();
      }
    });
    localTextView3.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NewMainActivity.this.Isboundphone();
        NewMainActivity.this.popupWindowRight.dismiss();
      }
    });
    localTextView4.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NewMainActivity.this.startActivity(new Intent(NewMainActivity.this, CustomServiceActivity.class));
        NewMainActivity.this.popupWindowRight.dismiss();
      }
    });
    this.popupWindowRight.setTouchable(true);
    this.popupWindowRight.setTouchInterceptor(new View.OnTouchListener()
    {
      public boolean onTouch(View paramAnonymousView, MotionEvent paramAnonymousMotionEvent)
      {
        LogUtils.i("mengdd", "onTouch : ");
        return false;
      }
    });
    this.popupWindowRight.setBackgroundDrawable(getResources().getDrawable(2130837536));
    this.popupWindowRight.showAsDropDown(this.iv_title_right, 0, 0);
    this.popupWindowRight.setOnDismissListener(new PopupWindow.OnDismissListener()
    {
      public void onDismiss()
      {
        LogUtils.d(NewMainActivity.this.TAG, "popupWindowRight消失");
        NewMainActivity.this.iv_title_right.setImageResource(2130837626);
      }
    });
  }

  public void showtishi()
  {
    this.windowManager = getWindowManager();
    this.img = new ImageView(this);
    this.img.setLayoutParams(new ViewGroup.LayoutParams(-1, -1));
    this.img.setScaleType(ImageView.ScaleType.FIT_XY);
    this.img.setImageResource(2130837983);
    WindowManager.LayoutParams localLayoutParams = new WindowManager.LayoutParams();
    localLayoutParams.type = 99;
    localLayoutParams.format = 1;
    localLayoutParams.gravity = 51;
    localLayoutParams.width = Utility.getScreenWidth(this);
    localLayoutParams.height = Utility.getScreenWidthHeight(this);
    this.windowManager.addView(this.img, localLayoutParams);
    this.img.setOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        NewMainActivity.this.windowManager.removeView(NewMainActivity.this.img);
      }
    });
  }

  public void startPhotoZoom(Uri paramUri)
  {
    LogUtils.d(this.TAG, "裁剪图片宽高:" + CustomApplication.app.displayMetrics.widthPixels);
    Intent localIntent = new Intent("com.android.camera.action.CROP");
    localIntent.setDataAndType(paramUri, AppFinal.IMAGE_UNSPECIFIED);
    LogUtils.d("Uri:", paramUri);
    localIntent.putExtra("crop", "true");
    localIntent.putExtra("aspectX", 1);
    localIntent.putExtra("aspectY", 1);
    localIntent.putExtra("outputX", 400);
    localIntent.putExtra("outputY", 400);
    this.imgName = (System.currentTimeMillis() + ".jpg");
    this.uritempFile = Uri.parse("file:///" + AppFinal.CACHE_DIR_UPLOADING_IMG + "/" + this.imgName);
    localIntent.putExtra("output", this.uritempFile);
    localIntent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());
    startActivityForResult(localIntent, 3);
  }

  public void takePhoto()
  {
    Intent localIntent = new Intent("android.media.action.IMAGE_CAPTURE");
    File localFile = new File(AppFinal.CACHE_DIR_IMAGE, "nc_" + System.currentTimeMillis() + ".jpg");
    localIntent.putExtra("output", Uri.fromFile(localFile));
    this.camera_fileName = localFile.getAbsolutePath();
    LogUtils.d(this.TAG, "camera_fileName:" + this.camera_fileName);
    startActivityForResult(localIntent, 1);
  }

  class MyGestureListener
    implements View.OnTouchListener
  {
    MyGestureListener()
    {
    }

    public boolean onTouch(View paramView, MotionEvent paramMotionEvent)
    {
      switch (paramMotionEvent.getAction())
      {
      case 2:
      default:
      case 0:
      case 1:
      }
      while (true)
      {
        return true;
        NewMainActivity.this.mPosY = paramMotionEvent.getY();
        LogUtils.e(NewMainActivity.this.TAG, "DOWN-Y:" + NewMainActivity.this.mPosY);
        continue;
        LogUtils.d(NewMainActivity.this.TAG, "UP-Y:" + paramMotionEvent.getY());
        LogUtils.e(NewMainActivity.this.TAG, "DOWN-Y:" + NewMainActivity.this.mPosY);
        LogUtils.d(NewMainActivity.this.TAG, "差值:" + (NewMainActivity.this.mPosY - paramMotionEvent.getY()));
        if ((NewMainActivity.this.mPosY - paramMotionEvent.getY() > 300.0F) && (NewMainActivity.this.popWindowLeft != null) && (NewMainActivity.this.popWindowLeft.isShowing()))
          NewMainActivity.this.popWindowLeft.dismiss();
      }
    }
  }

  public class MyReceiver extends BroadcastReceiver
  {
    public MyReceiver()
    {
    }

    public void onReceive(Context paramContext, Intent paramIntent)
    {
      if (paramIntent.getAction().equals("android.net.conn.CONNECTIVITY_CHANGE"))
      {
        if ((SystemHelper.isConnected(paramContext)) && (SystemHelper.getNetworkType(paramContext) != -1))
        {
          CustomApplication.app.isNetConnect = true;
          SystemHelper.getNetworkType(paramContext);
          SystemHelper.getNetworkType(paramContext);
          if (NewMainActivity.this.indexFragment != null)
            NewMainActivity.this.indexFragment.getDatasFromServer();
          if (NewMainActivity.this.dongtaiFragment != null)
            NewMainActivity.this.dongtaiFragment.getDataFromServer();
          NewMainActivity.this.httpupdate();
        }
      }
      else
        return;
      CustomApplication.app.isNetConnect = false;
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.newui.NewMainActivity
 * JD-Core Version:    0.6.2
 */